Skip to content
Snippets Groups Projects
Commit 3243071d authored by Langella Olivier's avatar Langella Olivier
Browse files

first X\!Tandem run ok

parent 5760c828
No related branches found
No related tags found
No related merge requests found
......@@ -30,8 +30,8 @@
#include "tandembatchprocess.h"
#include <QProcess>
#include <pappsomspp/pappsoexception.h>
#include <QXmlStreamWriter>
#include <QFileInfo>
#include <QDebug>
TandemBatchProcess::TandemBatchProcess(WorkMonitorInterface * p_monitor, const TandemRunBatch & tandem_run_batch) {
_tandem_run_batch = tandem_run_batch;
......@@ -79,6 +79,7 @@ void TandemBatchProcess::prepareXmlDatabaseFile() {
void TandemBatchProcess::run() {
qDebug() << "TandemBatchProcess::run begin " << _tandem_run_batch._preset_file;
_preset_file = _tandem_run_batch._preset_file;
prepareXmlDatabaseFile();
......@@ -86,6 +87,7 @@ void TandemBatchProcess::run() {
for (QString mz_file : _tandem_run_batch._mz_file_list) {
runOne(mz_file);
}
qDebug() << "TandemBatchProcess::run end" ;
}
void TandemBatchProcess::writeXmlInputFile (QXmlStreamWriter * p_out, const QString & mz_file) {
......@@ -98,7 +100,7 @@ void TandemBatchProcess::writeXmlInputFile (QXmlStreamWriter * p_out, const QStr
//<bioml label="20170405_Delastour_11.xml">
p_out->writeStartElement("bioml");
p_out->writeAttribute("label",mz_file_info.getFilename());
p_out->writeAttribute("label",mz_file_info.fileName());
//<note type="heading">Paths</note>
p_out->writeStartElement("note");
......@@ -117,7 +119,7 @@ void TandemBatchProcess::writeXmlInputFile (QXmlStreamWriter * p_out, const QStr
p_out->writeStartElement("note");
p_out->writeAttribute("type","input");
p_out->writeAttribute("label","list path, taxonomy information");
p_out->writeCharacters(_xml_database_file.getFilename());
p_out->writeCharacters(_xml_database_file.fileName());
p_out->writeEndElement();
......@@ -148,10 +150,11 @@ void TandemBatchProcess::writeXmlInputFile (QXmlStreamWriter * p_out, const QStr
p_out->writeEndElement();
//<note type="input" label="output, path">/gorgone/pappso/jouy/users/Didier/Xcal2017/2017_05_04_Delastours/Interrogation_souches_sequencees/Patient27/J42/20170405_Delastour_11.xml</note>
p_out->writeStartElement("note");
p_out->writeAttribute("type","input");
p_out->writeAttribute("label","output, path");
p_out->writeCharacters("usedefined");
p_out->writeCharacters(QString("%1/%2.xml").arg(_tandem_run_batch._output_directory).arg(mz_file_info.baseName()));
p_out->writeEndElement();
//</bioml>
......@@ -163,6 +166,7 @@ void TandemBatchProcess::writeXmlInputFile (QXmlStreamWriter * p_out, const QStr
void TandemBatchProcess::runOne(const QString & mz_file) {
QTemporaryFile xml_input_file;
xml_input_file.setAutoRemove(false);
if (xml_input_file.open())
{
QXmlStreamWriter * p_out = new QXmlStreamWriter();
......@@ -200,7 +204,7 @@ void TandemBatchProcess::runOne(const QString & mz_file) {
if (Status != 0)
{
// != QProcess::NormalExit
throw pappso::PappsoException(QObject::tr("error executing X!Tandem Status != 0 : %1 %2\n%3").arg(_tandem_run_batch._tandem_bin_path).arg(arguments.join(" ").arg(result.toStdString().c_str())));
throw pappso::PappsoException(QObject::tr("error executing X!Tandem Status != 0 : %1 %2\n%3").arg(_tandem_run_batch._tandem_bin_path).arg(arguments.join(" ").arg(result.data())));
}
delete xt_process;
......
......@@ -32,6 +32,7 @@
#include "tandemrunbatch.h"
#include "../../utils/workmonitor.h"
#include <QTemporaryFile>
#include <QXmlStreamWriter>
class TandemBatchProcess
{
......
......@@ -198,7 +198,7 @@ TandemRunBatch TandemRunDialog::getTandemRunBatch() const {
tandem_run_batch._mz_file_list = _p_mz_file_list->stringList();
tandem_run_batch._fasta_file_list = _p_fasta_file_list->stringList();
//tandem_run_batch._preset_file = ui->preset_combobox->itemData(ui->preset_combobox->currentIndex()).value<QFileInfo>().absoluteFilePath();
tandem_run_batch._preset_file = ui->preset_combobox->itemData(ui->preset_combobox->currentIndex()).value<QFileInfo>().absoluteFilePath();
tandem_run_batch._preset_file = ui->preset_combobox->itemData(ui->preset_combobox->currentIndex()).value<QString>();
tandem_run_batch._output_directory = ui->output_directory_label->text();
return tandem_run_batch;
}
......@@ -295,9 +295,10 @@ void WorkerThread::doRunningXtandem(TandemRunBatch tandem_run_batch) {
try {
emit loadingMessage(tr("Running X!Tandem, please wait"));
qDebug() << "WorkerThread::doRunningXtandem tandem_run_batch " << tandem_run_batch._tandem_bin_path;
TandemBatchProcess xt_process (_p_work_monitor, tandem_run_batch);
xt_process.run();
emit operationFinished();
}
catch (pappso::PappsoException & error) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment