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

Function assembleOverlappingPaths

PathOverlap/PathOverlap.cpp:535–575  ·  view source on GitHub ↗

Assemble overlapping paths. */

Source from the content-addressed store, hash-verified

533
534/** Assemble overlapping paths. */
535static void
536assembleOverlappingPaths(Graph& g, Paths& paths, vector<string>& pathIDs)
537{
538 if (paths.empty())
539 return;
540
541 // Find overlapping paths.
542 Overlaps overlaps = findOverlaps(g, paths);
543 addPathOverlapEdges(g, paths, pathIDs, overlaps);
544
545 // Create a property map of path overlaps.
546 OverlapMap overlapMap;
547 for (Overlaps::const_iterator it = overlaps.begin(); it != overlaps.end(); ++it)
548 overlapMap.insert(OverlapMap::value_type(
549 OverlapMap::key_type(it->source.descriptor(), it->target.descriptor()), it->overlap));
550
551 // Assemble unambiguously overlapping paths.
552 Paths merges;
553 assemble_if(g, back_inserter(merges), IsPathOverlap(g, overlapMap, IsPositive<Graph>(g)));
554
555 // Merge overlapping paths.
556 g_contigNames.unlock();
557 assert(!pathIDs.empty());
558 setNextContigName(pathIDs.back());
559 for (Paths::const_iterator it = merges.begin(); it != merges.end(); ++it) {
560 string name = createContigName();
561 if (opt::verbose > 0)
562 cerr << name << '\t' << *it << '\n';
563 Vertex u(paths.size(), false);
564 put(vertex_name, g, u.descriptor(), name);
565 pathIDs.push_back(name);
566 paths.push_back(mergePaths(paths, overlapMap, *it));
567
568 // Remove the merged paths.
569 for (ContigPath::const_iterator it2 = it->begin(); it2 != it->end(); ++it2) {
570 if (isPath(*it2))
571 paths[it2->id() - Vertex::s_offset].clear();
572 }
573 }
574 g_contigNames.lock();
575}
576
577int
578main(int argc, char** argv)

Callers 1

mainFunction · 0.85

Calls 15

addPathOverlapEdgesFunction · 0.85
assemble_ifFunction · 0.85
IsPathOverlapClass · 0.85
setNextContigNameFunction · 0.85
createContigNameFunction · 0.85
isPathFunction · 0.85
descriptorMethod · 0.80
unlockMethod · 0.80
idMethod · 0.80
lockMethod · 0.80
findOverlapsFunction · 0.70
mergePathsFunction · 0.70

Tested by

no test coverage detected