MCPcopy Create free account
hub / github.com/BirolLab/abyss / extendPaths

Function extendPaths

MergePaths/MergePaths.cpp:454–486  ·  view source on GitHub ↗

Extend the specified path as long as is unambiguously possible and * add the result to the specified container. */

Source from the content-addressed store, hash-verified

452 * add the result to the specified container.
453 */
454static void
455extendPaths(const Lengths& lengths, ContigID id, const ContigPathMap& paths, ContigPathMap& out)
456{
457 ContigPathMap::const_iterator pathIt = paths.find(id);
458 assert(pathIt != paths.end());
459
460 pair<ContigPathMap::iterator, bool> inserted;
461#pragma omp critical(out)
462 inserted = out.insert(*pathIt);
463 assert(inserted.second);
464 ContigPath& path = inserted.first->second;
465
466 if (gDebugPrint)
467#pragma omp critical(cout)
468 cout << "\n* " << get(g_contigNames, id) << "+\n" << '\t' << path << '\n';
469
470 set<ContigNode> seen;
471 seen.insert(ContigNode(id, false));
472 deque<ContigNode> mergeQ;
473 appendToMergeQ(mergeQ, seen, path);
474 while (mergePaths(lengths, path, mergeQ, seen, paths) > 0)
475 ;
476
477 if (!mergeQ.empty() && gDebugPrint) {
478#pragma omp critical(cout)
479 {
480 cout << "invalid\n";
481 for (deque<ContigNode>::const_iterator it = mergeQ.begin(); it != mergeQ.end(); ++it)
482 cout << get(g_contigNames, *it) << '\t' << paths.find(it->contigIndex())->second
483 << '\n';
484 }
485 }
486}
487
488/** Return true if the contigs are equal or both are ambiguous. */
489static bool

Callers 1

mainFunction · 0.85

Calls 10

ContigNodeClass · 0.85
appendToMergeQFunction · 0.85
contigIndexMethod · 0.80
getFunction · 0.70
mergePathsFunction · 0.70
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected