| 103 | } |
| 104 | |
| 105 | ExitCodes main_(int, const char**) override |
| 106 | { |
| 107 | //------------------------------------------------------------- |
| 108 | // general variables and data to perform PSMFeatureExtractor |
| 109 | //------------------------------------------------------------- |
| 110 | vector<PeptideIdentification> all_peptide_ids; |
| 111 | vector<ProteinIdentification> all_protein_ids; |
| 112 | |
| 113 | //------------------------------------------------------------- |
| 114 | // parsing parameters |
| 115 | //------------------------------------------------------------- |
| 116 | const StringList in_list = getStringList_("in"); |
| 117 | bool multiple_search_engines = getFlag_("multiple_search_engines"); |
| 118 | OPENMS_LOG_DEBUG << "Input file (of target?): " << ListUtils::concatenate(in_list, ",") << endl; |
| 119 | if (in_list.size() > 1 && !multiple_search_engines) |
| 120 | { |
| 121 | writeLogError_("Error: multiple input files given for -in, but -multiple_search_engines flag not specified. If the same search engine was used, feed the input files into PSMFeatureExtractor one by one."); |
| 122 | printUsage_(); |
| 123 | return ILLEGAL_PARAMETERS; |
| 124 | } |
| 125 | |
| 126 | const String out(getStringOption_("out")); |
| 127 | |
| 128 | //------------------------------------------------------------- |
| 129 | // read input |
| 130 | //------------------------------------------------------------- |
| 131 | bool skip_db_check = getFlag_("skip_db_check"); |
| 132 | bool concatenate = getFlag_("concat"); |
| 133 | StringList search_engines_used; |
| 134 | for (StringList::const_iterator fit = in_list.begin(); fit != in_list.end(); ++fit) |
| 135 | { |
| 136 | vector<PeptideIdentification> peptide_ids; |
| 137 | vector<ProteinIdentification> protein_ids; |
| 138 | String in = *fit; |
| 139 | FileHandler fh; |
| 140 | FileTypes::Type in_type = fh.getType(in); |
| 141 | OPENMS_LOG_INFO << "Loading input file: " << in << endl; |
| 142 | if (in_type == FileTypes::IDXML) |
| 143 | { |
| 144 | IdXMLFile().load(in, protein_ids, peptide_ids); |
| 145 | } |
| 146 | else if (in_type == FileTypes::MZIDENTML) |
| 147 | { |
| 148 | OPENMS_LOG_WARN << "Converting from mzid: possible loss of information depending on target format." << endl; |
| 149 | MzIdentMLFile().load(in, protein_ids, peptide_ids); |
| 150 | } |
| 151 | //else caught by TOPPBase:registerInput being mandatory mzid or idxml |
| 152 | |
| 153 | //check and warn if merged from multiple runs |
| 154 | if (protein_ids.size() > 1) |
| 155 | { |
| 156 | throw Exception::InvalidValue( |
| 157 | __FILE__, |
| 158 | __LINE__, |
| 159 | OPENMS_PRETTY_FUNCTION, |
| 160 | "File '" + in + "' has more than one ProteinIDRun. This is currently not correctly handled." |
| 161 | "Please use the merge_proteins_add_psms option if you used IDMerger. Alternatively, pass" |
| 162 | " all original single-run idXML inputs as list to this tool.", |
nothing calls this directly
no test coverage detected