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

Method buildGraph_

src/openms/source/ANALYSIS/ID/IDBoostGraph.cpp:396–423  ·  view source on GitHub ↗

TODO actually to build the graph, the inputs could be passed const. But if you want to do sth on the graph later it needs to be non-const. Overload the next functions or somehow make sure it can be used const.

Source from the content-addressed store, hash-verified

394 //TODO actually to build the graph, the inputs could be passed const. But if you want to do sth
395 // on the graph later it needs to be non-const. Overload the next functions or somehow make sure it can be used const.
396 void IDBoostGraph::buildGraph_(ProteinIdentification& proteins,
397 std::vector<PeptideIdentification>& idedSpectra,
398 Size use_top_psms,
399 bool best_psms_annotated)
400 {
401 unordered_map<IDPointer, vertex_t, boost::hash<IDPointer>> vertex_map{};
402
403 unordered_map<string, ProteinHit*> accession_map{};
404
405 for (auto& prot : proteins.getHits())
406 {
407 accession_map[prot.getAccession()] = &prot;
408 }
409
410 ProgressLogger pl;
411 pl.setLogType(ProgressLogger::CMD);
412 pl.startProgress(0, idedSpectra.size(), "Building graph...");
413 const String& protRun = proteins.getIdentifier();
414 for (auto& spectrum : idedSpectra)
415 {
416 if (spectrum.getIdentifier() == protRun)
417 {
418 addPeptideIDWithAssociatedProteins_(spectrum, vertex_map, accession_map, use_top_psms, best_psms_annotated);
419 }
420 pl.nextProgress();
421 }
422 pl.endProgress();
423 }
424
425
426 void IDBoostGraph::buildGraph_(ProteinIdentification& proteins,

Callers

nothing calls this directly

Calls 7

getAccessionMethod · 0.80
setLogTypeMethod · 0.80
startProgressMethod · 0.45
sizeMethod · 0.45
nextProgressMethod · 0.45
endProgressMethod · 0.45
getPrimaryMSRunPathMethod · 0.45

Tested by

no test coverage detected