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

Function addPathOverlapEdges

PathOverlap/PathOverlap.cpp:427–464  ·  view source on GitHub ↗

Add the path overlap edges to the specified graph. */

Source from the content-addressed store, hash-verified

425
426/** Add the path overlap edges to the specified graph. */
427static void
428addPathOverlapEdges(
429 Graph& g,
430 const Paths& paths,
431 const vector<string>& pathIDs,
432 const Overlaps& overlaps)
433{
434 typedef graph_traits<Graph>::vertex_descriptor V;
435 const bool allowParallelEdge = opt::mode == opt::ASSEMBLE;
436
437 // Add the path vertices.
438 g_contigNames.unlock();
439 for (Paths::const_iterator it = paths.begin(); it != paths.end(); ++it) {
440 const ContigPath& path = *it;
441 const string& id = pathIDs[it - paths.begin()];
442 if (!path.empty()) {
443 V u = merge(g, path.begin(), path.end());
444 put(vertex_name, g, u, id);
445 }
446 }
447 g_contigNames.lock();
448
449 // Remove the single-end contigs that are in paths.
450 for (Paths::const_iterator it = paths.begin(); it != paths.end(); ++it)
451 remove_vertex_if(
452 g, it->begin(), it->end(), [](const ContigNode& c) { return !c.ambiguous(); });
453
454 // Add the path edges.
455 for (Overlaps::const_iterator it = overlaps.begin(); it != overlaps.end(); ++it) {
456 V u = it->source.descriptor();
457 V v = it->target.descriptor();
458 if (allowParallelEdge || !edge(u, v, g).second)
459 add_edge(u, v, it->distance, static_cast<DG&>(g));
460 else if (opt::verbose > 0)
461 cerr << "ambiguous overlap: " << get(vertex_name, g, u) << " -> "
462 << get(vertex_name, g, v) << '\n';
463 }
464}
465
466typedef graph_traits<Graph>::edge_descriptor edge_descriptor;
467

Callers 2

assembleOverlappingPathsFunction · 0.85
mainFunction · 0.85

Calls 13

remove_vertex_ifFunction · 0.85
unlockMethod · 0.80
lockMethod · 0.80
ambiguousMethod · 0.80
descriptorMethod · 0.80
getFunction · 0.70
mergeFunction · 0.50
putFunction · 0.50
edgeFunction · 0.50
add_edgeFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected