diff --git a/src/core/tandem_run/tandembatchprocess.cpp b/src/core/tandem_run/tandembatchprocess.cpp index 20c2d4b331260b7ad70c43dec610830f492f6d43..50005afa61b60d2203bac7520351bc0ceaa218e3 100644 --- a/src/core/tandem_run/tandembatchprocess.cpp +++ b/src/core/tandem_run/tandembatchprocess.cpp @@ -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; diff --git a/src/core/tandem_run/tandembatchprocess.h b/src/core/tandem_run/tandembatchprocess.h index 9e1dbdbc324c622a955df15758814923abaa9e52..cdc6397e75a01e8c856cc63ea0aa7c3f87169672 100644 --- a/src/core/tandem_run/tandembatchprocess.h +++ b/src/core/tandem_run/tandembatchprocess.h @@ -32,6 +32,7 @@ #include "tandemrunbatch.h" #include "../../utils/workmonitor.h" #include <QTemporaryFile> +#include <QXmlStreamWriter> class TandemBatchProcess { diff --git a/src/gui/tandem_run_dialog/tandemrundialog.cpp b/src/gui/tandem_run_dialog/tandemrundialog.cpp index 9d40f8e8e902b13e16ce018ed394035af374cbf9..e3a2ebf8367d08bd3c9b92a4a448b2c08d952519 100644 --- a/src/gui/tandem_run_dialog/tandemrundialog.cpp +++ b/src/gui/tandem_run_dialog/tandemrundialog.cpp @@ -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; } diff --git a/src/gui/workerthread.cpp b/src/gui/workerthread.cpp index 39889c4c0170209c050acb1d29b6ddb5a92773c4..4958d4c2a02e719f95a891b100bb7f0392762d3f 100644 --- a/src/gui/workerthread.cpp +++ b/src/gui/workerthread.cpp @@ -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) {