diff --git a/src/core/tandem_run/tandembatchprocess.cpp b/src/core/tandem_run/tandembatchprocess.cpp index 34f72e6d880bbfe4cb242c6d2f8777911f2fab0f..7497799a1a339ef99c6f14dc0977864904860bef 100644 --- a/src/core/tandem_run/tandembatchprocess.cpp +++ b/src/core/tandem_run/tandembatchprocess.cpp @@ -342,7 +342,8 @@ TandemBatchProcess::runOne(const QString &mz_file) QString tandem_path; QSettings settings; - if(QFileInfo(mz_file).completeSuffix() != "tdf") + if(!QFileInfo(mz_file).isDir() && + QFileInfo(mz_file).completeSuffix() != "tdf") { arguments << xml_input_file.fileName(); tandem_path = _tandem_run_batch._tandem_bin_path; @@ -402,8 +403,7 @@ TandemBatchProcess::runOne(const QString &mz_file) const QDateTime dt_begin = QDateTime::currentDateTime(); QSettings settings; QString tmpDirOption = - settings.value("timstof/tmp_dir_path", QDir::tempPath()) - .toString(); + settings.value("timstof/tmp_dir_path", QDir::tempPath()).toString(); if(!QDir(tmpDirOption).exists()) { QDir().mkdir(tmpDirOption); diff --git a/src/gui/tandem_run_dialog/tandem_run_dialog.ui b/src/gui/tandem_run_dialog/tandem_run_dialog.ui index 2dda25f279daef2d5f352af6b2e6e438bc599ff0..4856d680aabb0391d31458e74f7b5ec17e5ef5ae 100644 --- a/src/gui/tandem_run_dialog/tandem_run_dialog.ui +++ b/src/gui/tandem_run_dialog/tandem_run_dialog.ui @@ -26,9 +26,9 @@ 0 - 0 + -93 541 - 684 + 671 @@ -172,6 +172,9 @@ edit + + + @@ -206,6 +209,9 @@ clear list + + + @@ -213,6 +219,9 @@ add files + + + @@ -249,6 +258,19 @@ clear list + + + + + + + + + add timsTOF folder + + + + @@ -256,6 +278,9 @@ add files + + + @@ -294,6 +319,9 @@ choose + + + @@ -337,6 +365,9 @@ Cancel + + + @@ -344,6 +375,9 @@ Run + + + @@ -359,8 +393,8 @@ reject() - 476 - 708 + 478 + 622 568 @@ -375,8 +409,8 @@ accept() - 562 - 708 + 564 + 622 572 @@ -391,8 +425,8 @@ clearFastaFiles() - 464 - 404 + 438 + 329 572 @@ -407,8 +441,8 @@ selectFastaFiles() - 550 - 404 + 528 + 329 572 @@ -423,8 +457,8 @@ selectMzFiles() - 550 - 579 + 528 + 486 572 @@ -439,8 +473,8 @@ selectOutputDirectory() - 551 - 661 + 529 + 566 572 @@ -455,8 +489,8 @@ setPresetName(QString) - 85 - 231 + 106 + 173 572 @@ -471,8 +505,8 @@ editPresets() - 551 - 231 + 529 + 173 572 @@ -487,8 +521,8 @@ exeGroupBoxClicked(bool) - 559 - 110 + 541 + 26 959 @@ -503,8 +537,8 @@ clearMzFiles() - 406 - 566 + 274 + 486 995 @@ -519,8 +553,8 @@ selectXtandemExe() - 520 - 57 + 528 + -13 793 @@ -528,6 +562,22 @@ + + pushButton_6 + clicked() + TandemRunDialog + selectTdfFolder() + + + 373 + 476 + + + 756 + 508 + + + reject() @@ -541,5 +591,6 @@ exeGroupBoxClicked(bool) clearMzFiles() selectXtandemExe() + selectTdfFolder() diff --git a/src/gui/tandem_run_dialog/tandemrundialog.cpp b/src/gui/tandem_run_dialog/tandemrundialog.cpp index b211b66d6cb9c4fe0fc89be174061f0c92d01379..11a5e05afd3233a779b11dda546f6c3334be93e2 100644 --- a/src/gui/tandem_run_dialog/tandemrundialog.cpp +++ b/src/gui/tandem_run_dialog/tandemrundialog.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -397,6 +398,62 @@ TandemRunDialog::selectMzFiles() } } +void +TandemRunDialog::selectTdfFolder() +{ + try + { + QSettings settings; + QString default_tdf_location = + settings.value("path/tandemrun_tdf_directory", "").toString(); + QFileDialog directories_dialog; + directories_dialog.setFileMode(QFileDialog::DirectoryOnly); + directories_dialog.setOption(QFileDialog::DontUseNativeDialog, true); + directories_dialog.setWindowTitle("Select the timsTOF folders"); + QListView *lView = directories_dialog.findChild("listView"); + if(lView) + lView->setSelectionMode(QAbstractItemView::MultiSelection); + QTreeView *tView = directories_dialog.findChild(); + if(tView) + tView->setSelectionMode(QAbstractItemView::MultiSelection); + directories_dialog.exec(); + + QStringList directories_names; + if(directories_dialog.result() == QDialog::Accepted) + { + directories_names = directories_dialog.selectedFiles(); + } + + if(directories_names.size() > 0) + { + settings.setValue("path/tandemrun_tdf_directory", + QFileInfo(directories_names[0]).absolutePath()); + } + for(QString directory_name : directories_names) + { + if(!QFileInfo(directory_name + "/analysis.tdf").exists()) + { + throw pappso::PappsoException( + tr( + "The directory %1/ dosent contain the mandatory analysis.tdf " + "file") + .arg(directory_name)); + } + } + + QStringList file_list = _p_mz_file_list->stringList(); + file_list.append(directories_names); + _p_mz_file_list->setStringList(file_list); + + } + catch(pappso::PappsoException &error) + { + QMessageBox::warning( + this, tr("Error choosing identification result files"), error.qwhat()); + } +} + + void TandemRunDialog::clearMzFiles() { diff --git a/src/gui/tandem_run_dialog/tandemrundialog.h b/src/gui/tandem_run_dialog/tandemrundialog.h index f2497ae6761b995343824813f9b2b4ad33f97685..23ceb5cc08275a3e9f13e93027d2e13875d4c372 100644 --- a/src/gui/tandem_run_dialog/tandemrundialog.h +++ b/src/gui/tandem_run_dialog/tandemrundialog.h @@ -53,6 +53,7 @@ class TandemRunDialog : public QDialog void clearFastaFiles(); void selectXtandemExe(); void selectMzFiles(); + void selectTdfFolder(); void clearMzFiles(); void selectOutputDirectory(); void selectPresetDirectory();