MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / write_out_body_best_score

Function write_out_body_best_score

src/topp/OpenSwathFeatureXMLToTSV.cpp:297–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297void write_out_body_best_score(std::ostream &os, FeatureMap &feature_map,
298 TargetedExperiment &transition_exp, std::vector<String> &meta_value_names,
299 int run_id, bool short_format, String best_score, String filename)
300{
301
302 // for each peptide reference search for the best feature
303 typedef std::map<String, std::vector<Feature *> > PeptideFeatureMapType;
304 PeptideFeatureMapType peptide_feature_map;
305 for (Feature& feature : feature_map)
306 {
307 String peptide_ref = feature.getMetaValue("PeptideRef");
308 peptide_feature_map[peptide_ref].push_back(&feature);
309 }
310
311 for (PeptideFeatureMapType::iterator peptide_it = peptide_feature_map.begin(); peptide_it != peptide_feature_map.end(); ++peptide_it)
312 {
313 if (peptide_it->second.size() > 1)
314 {
315 //std::cout << "Warning " << peptide_it->first << " has " << peptide_it->second.size() << " features!" << std::endl;
316 // for (Size j =0; j<peptide_it->second.size(); j++)
317 // std::cout << *peptide_it->second.at(j) << std::endl;
318 }
319 }
320
321 for (PeptideFeatureMapType::iterator peptide_it = peptide_feature_map.begin(); peptide_it != peptide_feature_map.end(); ++peptide_it)
322 {
323 Feature *bestfeature = find_best_feature(peptide_it->second, best_score);
324 if (bestfeature == nullptr)
325 {
326 throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Did not find best feature for peptide " + peptide_it->first);
327 }
328 write_out_body_(os, bestfeature, transition_exp, meta_value_names, run_id, short_format, feature_map.getIdentifier(), filename);
329 }
330}
331
332
333class TOPPOpenSwathFeatureXMLToTSV

Callers 1

main_Method · 0.85

Calls 7

find_best_featureFunction · 0.85
write_out_body_Function · 0.85
getMetaValueMethod · 0.80
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected