| 46 | } |
| 47 | |
| 48 | SwathTabWidget::SwathTabWidget(QWidget* parent) : |
| 49 | QTabWidget(parent), |
| 50 | ui(new Ui::SwathTabWidget), |
| 51 | ep_([&](const String& out) {writeLog_(out.toQString());}, |
| 52 | [&](const String& out) {writeLog_(out.toQString());}) |
| 53 | { |
| 54 | ui->setupUi(this); |
| 55 | |
| 56 | writeLog_(QString("Welcome to the Wizard!"), Qt::darkGreen, true); |
| 57 | |
| 58 | auto py_selector = (PythonSelector*)ui->py_selector; |
| 59 | |
| 60 | auto py_pyprophet = (PythonModuleRequirement*)ui->py_pyprophet; |
| 61 | py_pyprophet->setRequiredModules( { "pyprophet", "msproteomicstoolslib" }); |
| 62 | py_pyprophet->setFreeText("In order to run PyProphet and TRIC after OpenSWATH, the above modules need to be installed\n" \ |
| 63 | "Once they are available, the 'PyProphet and TRIC' tab will become active and configurable.\n" \ |
| 64 | "To install the modules, visit the <a href=\"http://www.openswath.org\">openswath.org homepage</a> and follow the installation instructions."); |
| 65 | py_pyprophet->setTitle("External: PyProphet and TRIC tools"); |
| 66 | connect(py_selector, &PythonSelector::valueChanged, py_pyprophet, &PythonModuleRequirement::validate); |
| 67 | |
| 68 | // call once to update py_pyprophet canvas |
| 69 | // alternative: load latest data from .ini and set py_selector (will update py_pyprophet via above signal/slot) |
| 70 | py_pyprophet->validate(py_selector->getLastPython().toQString()); |
| 71 | |
| 72 | ui->input_tr->setFileFormatFilter("Transition sqLite file (*.pqp)"); |
| 73 | ui->input_iRT->setFileFormatFilter("Transition sqLite file (*.pqp)"); |
| 74 | |
| 75 | // create a default INI of OpenSwathWorkflow |
| 76 | String tmp_file = File::getTemporaryFile(); |
| 77 | if (ep_.run(this, getOSWExe().toQString(), QStringList() << "-write_ini" << tmp_file.toQString(), "", true) != ExternalProcess::RETURNSTATE::SUCCESS) |
| 78 | { |
| 79 | exit(1); |
| 80 | } |
| 81 | |
| 82 | ParamXMLFile().load(tmp_file, swath_param_); |
| 83 | swath_param_ = swath_param_.copy("OpenSwathWorkflow:1:", true); |
| 84 | // parameters to show within the Wizard: |
| 85 | StringList extract = {"mz_extraction_window", "rt_extraction_window", "threads"}; |
| 86 | |
| 87 | for (const auto& name : extract) swath_param_wizard_.setValue(name, ""); // create a dummy param, just so we can use ::copySubset |
| 88 | swath_param_wizard_ = swath_param_.copySubset(swath_param_wizard_); |
| 89 | |
| 90 | ui->list_editor->load(swath_param_wizard_); |
| 91 | |
| 92 | // keep the group of input widgets in sync with respect to their current-working-dir, when browsing for new files |
| 93 | connect(ui->input_mzMLs, &InputFileList::updatedCWD, this, &SwathTabWidget::broadcastNewCWD_); |
| 94 | connect(ui->input_iRT, &InputFile::updatedCWD, this, &SwathTabWidget::broadcastNewCWD_); |
| 95 | connect(ui->input_tr, &InputFile::updatedCWD, this, &SwathTabWidget::broadcastNewCWD_); |
| 96 | connect(ui->input_swath_windows, &InputFile::updatedCWD, this, &SwathTabWidget::broadcastNewCWD_); |
| 97 | |
| 98 | // update information on assay libraries |
| 99 | connect(ui->input_iRT, &InputFile::updatedFile, ui->input_iRT_stats, &SwathLibraryStats::updateFromFile); |
| 100 | connect(ui->input_tr, &InputFile::updatedFile, ui->input_tr_stats, &SwathLibraryStats::updateFromFile); |
| 101 | |
| 102 | |
| 103 | // if out_dir (user defined output directory for OSW results) changes ... |
| 104 | connect(ui->out_dir, &OutputDirectory::directoryChanged, this, &SwathTabWidget::checkPyProphetInput_); |
| 105 | // ... or the mzML input changes --> update the input list of tbl_py_osws (which depend in the basenames of mzMLs and the OSW output directory) |
nothing calls this directly
no test coverage detected