| 412 | } |
| 413 | |
| 414 | ExitCodes main_(int, const char**) override |
| 415 | { |
| 416 | //------------------------------------------------------------- |
| 417 | // parse parameters |
| 418 | //------------------------------------------------------------- |
| 419 | |
| 420 | String in = getRawfileName(); |
| 421 | String out = getStringOption_("out"); |
| 422 | String mzid_out = getStringOption_("mzid_out"); |
| 423 | if (mzid_out.empty() && out.empty()) |
| 424 | { |
| 425 | writeLogError_("Error: no output file given (parameter 'out' or 'mzid_out')"); |
| 426 | return ILLEGAL_PARAMETERS; |
| 427 | } |
| 428 | |
| 429 | String java_executable = getStringOption_("java_executable"); |
| 430 | String db_name = getDBFilename(); |
| 431 | |
| 432 | vector<String> fixed_mods = getStringList_("fixed_modifications"); |
| 433 | vector<String> variable_mods = getStringList_("variable_modifications"); |
| 434 | bool no_mods = fixed_mods.empty() && variable_mods.empty(); |
| 435 | Int max_mods = getIntOption_("max_mods"); |
| 436 | if ((max_mods == 0) && !no_mods) |
| 437 | { |
| 438 | writeLogWarn_("Warning: Modifications are defined ('fixed_modifications'/'variable_modifications'), but the number of allowed modifications is zero ('max_mods'). Is that intended?"); |
| 439 | } |
| 440 | |
| 441 | if (!getFlag_("force")) |
| 442 | { |
| 443 | if (!JavaInfo::canRun(java_executable)) |
| 444 | { |
| 445 | writeLogError_("Fatal error: Java is needed to run MS-GF+!"); |
| 446 | return EXTERNAL_PROGRAM_ERROR; |
| 447 | } |
| 448 | } |
| 449 | else |
| 450 | { |
| 451 | writeLogWarn_("The installation of Java was not checked."); |
| 452 | } |
| 453 | |
| 454 | // create temporary directory (and modifications file, if necessary): |
| 455 | File::TempDir tmp_dir(debug_level_ >= 2); |
| 456 | String mzid_temp, mod_file; |
| 457 | // always create a temporary mzid file first, even if mzid output is requested via "mzid_out" |
| 458 | // (reason: TOPPAS may pass a filename with wrong extension to "mzid_out", which would cause an error in MzIDToTSVConverter below, |
| 459 | // so we make sure that we have a properly named mzid file for the converter; see https://github.com/OpenMS/OpenMS/issues/1251) |
| 460 | mzid_temp = tmp_dir.getPath() + "msgfplus_output.mzid"; |
| 461 | if (!no_mods) |
| 462 | { |
| 463 | mod_file = tmp_dir.getPath() + "msgfplus_mods.txt"; |
| 464 | writeModificationsFile_(mod_file, fixed_mods, variable_mods, max_mods); |
| 465 | } |
| 466 | |
| 467 | // parameters also used by OpenMS (see idXML creation below): |
| 468 | String enzyme = getStringOption_("enzyme"); |
| 469 | double precursor_mass_tol = getDoubleOption_("precursor_mass_tolerance"); |
| 470 | String precursor_error_units = getStringOption_("precursor_error_units"); |
| 471 | Int min_precursor_charge = getIntOption_("min_precursor_charge"); |
nothing calls this directly
no test coverage detected