| 138 | |
| 139 | |
| 140 | ExitCodes main_(int, const char**) override |
| 141 | { |
| 142 | StopWatch sw; |
| 143 | sw.start(); |
| 144 | StringList in = getStringList_("in"); |
| 145 | // Merging if specifically asked or multiple files given. If you want to not merge |
| 146 | // and use multiple files, use a loop |
| 147 | bool merge_runs = getStringOption_("merge_runs") == "all" || in.size() > 1; |
| 148 | String out = getStringOption_("out"); |
| 149 | String out_type = getStringOption_("out_type"); |
| 150 | // load identifications |
| 151 | OPENMS_LOG_INFO << "Loading input..." << std::endl; |
| 152 | |
| 153 | FileTypes::Type in_type = FileHandler::getType(in[0]); |
| 154 | |
| 155 | if (!in.empty() && in_type == FileTypes::CONSENSUSXML) |
| 156 | { |
| 157 | if (FileHandler::getTypeByFileName(out) != FileTypes::CONSENSUSXML && |
| 158 | FileTypes::nameToType(out_type) != FileTypes::CONSENSUSXML) |
| 159 | { |
| 160 | OPENMS_LOG_FATAL_ERROR << "Error: Running on consensusXML requires output as consensusXML. Please change the " |
| 161 | "output type.\n"; |
| 162 | } |
| 163 | |
| 164 | |
| 165 | if (in.size() > 1) |
| 166 | { |
| 167 | OPENMS_LOG_FATAL_ERROR << "Error: Multiple inputs only supported for idXML\n"; |
| 168 | } |
| 169 | |
| 170 | ConsensusMapMergerAlgorithm cmerge; |
| 171 | ConsensusMap cmap; |
| 172 | ConsensusXMLFile cxmlf; |
| 173 | OPENMS_LOG_INFO << "Loading input..." << std::endl; |
| 174 | cxmlf.load(in[0], cmap); |
| 175 | OPENMS_LOG_INFO << "Loading input took " << sw.toString() << std::endl; |
| 176 | sw.clear(); |
| 177 | |
| 178 | OPENMS_LOG_INFO << "Merging IDs across runs..." << std::endl; |
| 179 | cmerge.mergeAllIDRuns(cmap); |
| 180 | OPENMS_LOG_INFO << "Merging IDs across runs took " << sw.toString() << std::endl; |
| 181 | sw.clear(); |
| 182 | |
| 183 | OPENMS_LOG_INFO << "Aggregating protein scores..." << std::endl; |
| 184 | BasicProteinInferenceAlgorithm pi; |
| 185 | pi.setParameters(getParam_().copy("Algorithm:", true)); |
| 186 | pi.run(cmap, cmap.getProteinIdentifications()[0], true); |
| 187 | OPENMS_LOG_INFO << "Aggregating protein scores took " << sw.toString() << std::endl; |
| 188 | sw.clear(); |
| 189 | |
| 190 | bool calc_protFDR = getStringOption_("protein_fdr") == "true"; |
| 191 | if (calc_protFDR) |
| 192 | { |
| 193 | OPENMS_LOG_INFO << "Calculating target-decoy q-values..." << std::endl; |
| 194 | FalseDiscoveryRate fdr; |
| 195 | Param fdrparam = fdr.getParameters(); |
| 196 | fdrparam.setValue("conservative", getStringOption_("conservative_fdr")); |
| 197 | fdrparam.setValue("add_decoy_proteins","true"); |
nothing calls this directly
no test coverage detected