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

Method resolveGraph

src/openms/source/ANALYSIS/ID/PeptideProteinResolution.cpp:339–425  ·  view source on GitHub ↗

"Main" function

Source from the content-addressed store, hash-verified

337
338 // "Main" function
339 void PeptideProteinResolution::resolveGraph(ProteinIdentification& protein,
340 vector<PeptideIdentification>& peptides)
341 {
342 //Debugging
343 Size old_size = indist_prot_grp_to_pep_.size();
344
345 //Statistics
346 ConnectedComponent most_peps;
347 ConnectedComponent most_grps;
348 ConnectedComponent most_both;
349
350 // Traverse every connected component, remove visited "nodes" in each step
351 while (!indist_prot_grp_to_pep_.empty())
352 {
353 if (statistics_ && (old_size - indist_prot_grp_to_pep_.size() > 1))
354 {
355 OPENMS_LOG_INFO << "resolved group of size "
356 << old_size - indist_prot_grp_to_pep_.size() << " in last step "
357 << endl;
358 old_size = indist_prot_grp_to_pep_.size();
359 }
360
361 // We take any (= first) protein from map that is still left,
362 // to start the next BFS from it
363 Size root_prot_grp = indist_prot_grp_to_pep_.begin()->first;
364
365 // do BFS, return connected proteins and peptides
366 ConnectedComponent curr_component =
367 PeptideProteinResolution::findConnectedComponent(root_prot_grp);
368 // For debugging and statistics
369 if (statistics_)
370 {
371 if (curr_component.prot_grp_indices.size() >
372 most_grps.prot_grp_indices.size())
373 {
374 most_grps = curr_component;
375 }
376
377 if (curr_component.pep_indices.size() >
378 most_peps.pep_indices.size())
379 {
380 most_peps = curr_component;
381 }
382
383 if ((curr_component.prot_grp_indices.size() +
384 curr_component.pep_indices.size()) >
385 (most_both.prot_grp_indices.size() +
386 most_both.pep_indices.size()))
387 {
388 most_both = curr_component;
389 }
390
391 if (curr_component.prot_grp_indices.size() > 1)
392 {
393 OPENMS_LOG_INFO << "found group: " << endl;
394 OPENMS_LOG_INFO << curr_component;
395 OPENMS_LOG_INFO << endl << "Processing ..." << endl;
396 }

Callers 2

main_Method · 0.80
runMethod · 0.80

Calls 5

sizeMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected