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.
| 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, |
nothing calls this directly
no test coverage detected