tmp_msfile (store), all parameters, out_dir (tmpstructure)
| 546 | |
| 547 | // tmp_msfile (store), all parameters, out_dir (tmpstructure) |
| 548 | const std::vector<String> SiriusAdapterAlgorithm::callSiriusQProcess(const String& tmp_ms_file, |
| 549 | const String& tmp_out_dir, |
| 550 | String& executable, |
| 551 | const String& out_csifingerid, |
| 552 | const bool decoy_generation) const |
| 553 | |
| 554 | { |
| 555 | // get the command line parameters from all the subtools |
| 556 | QStringList project_params = project.getCommandLine(); |
| 557 | QStringList sirius_params = sirius.getCommandLine(); |
| 558 | QStringList fingerid_params = fingerid.getCommandLine(); |
| 559 | |
| 560 | const bool run_csifingerid = !out_csifingerid.empty(); |
| 561 | const bool run_passatutto = decoy_generation; |
| 562 | |
| 563 | // structure of the command line passed to NightSky (Sirius 4.X+) |
| 564 | // Add noCite and instead make sure the main citations are registered in our TOPP tool. |
| 565 | // Most of the time the user does not see the direct Sirius output anyway |
| 566 | QStringList command_line = QStringList("--noCite") + project_params + QStringList({"--input", tmp_ms_file.toQString(), "--project", tmp_out_dir.toQString(), "--no-compression", "sirius"}) + sirius_params; |
| 567 | |
| 568 | if (run_passatutto) |
| 569 | { |
| 570 | command_line << "passatutto"; |
| 571 | } |
| 572 | |
| 573 | if (run_csifingerid) |
| 574 | { |
| 575 | command_line << "fingerprint" << "structure" << fingerid_params; |
| 576 | } |
| 577 | |
| 578 | command_line << "write-summaries"; |
| 579 | |
| 580 | // the actual process |
| 581 | QProcess qp; |
| 582 | QString executable_qstring = SiriusAdapterAlgorithm::determineSiriusExecutable(executable).toQString(); |
| 583 | qp.start(executable_qstring, command_line); // does automatic escaping etc... start |
| 584 | std::stringstream ss; |
| 585 | |
| 586 | ss << "Executing command: " << executable_qstring.toStdString(); |
| 587 | for (const QString& it : command_line) |
| 588 | { |
| 589 | ss << " " << it.toStdString(); |
| 590 | } |
| 591 | OPENMS_LOG_WARN << ss.str() << std::endl; |
| 592 | |
| 593 | const bool success = qp.waitForFinished(-1); |
| 594 | |
| 595 | if (!success || qp.exitStatus() != 0 || qp.exitCode() != 0) |
| 596 | { |
| 597 | OPENMS_LOG_WARN << "FATAL: External invocation of Sirius failed. Standard output and error were:" << std::endl; |
| 598 | const QString sirius_stdout(qp.readAllStandardOutput()); |
| 599 | const QString sirius_stderr(qp.readAllStandardError()); |
| 600 | OPENMS_LOG_WARN << String(sirius_stdout) << std::endl; |
| 601 | OPENMS_LOG_WARN << String(sirius_stderr) << std::endl; |
| 602 | OPENMS_LOG_WARN << String(qp.exitCode()) << std::endl; |
| 603 | qp.close(); |
| 604 | |
| 605 | throw Exception::InvalidValue(__FILE__, |
no test coverage detected