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

Function removeSmallOverlaps

MergePaths/MergePaths.cpp:692–724  ·  view source on GitHub ↗

Remove ambiguous edges that overlap by only a small amount. * Remove the edge (u,v) if deg+(u) > 1 and deg-(v) > 1 and the * overlap of (u,v) is small. */

Source from the content-addressed store, hash-verified

690 * overlap of (u,v) is small.
691 */
692static void
693removeSmallOverlaps(PathGraph& g, const ContigPathMap& paths)
694{
695 typedef graph_traits<PathGraph>::edge_descriptor E;
696 typedef graph_traits<PathGraph>::out_edge_iterator Eit;
697 typedef graph_traits<PathGraph>::vertex_descriptor V;
698 typedef graph_traits<PathGraph>::vertex_iterator Vit;
699
700 vector<E> edges;
701 pair<Vit, Vit> urange = vertices(g);
702 for (Vit uit = urange.first; uit != urange.second; ++uit) {
703 V u = *uit;
704 if (out_degree(u, g) < 2)
705 continue;
706 ContigPath pathu = getPath(paths, u);
707 pair<Eit, Eit> uvits = out_edges(u, g);
708 for (Eit uvit = uvits.first; uvit != uvits.second; ++uvit) {
709 E uv = *uvit;
710 V v = target(uv, g);
711 assert(v != u);
712 if (in_degree(v, g) < 2)
713 continue;
714 ContigPath pathv = getPath(paths, v);
715 if (pathu.back() == pathv.front() && paths.count(pathu.back().contigIndex()) > 0)
716 edges.push_back(uv);
717 }
718 }
719 remove_edges(g, edges.begin(), edges.end());
720 if (opt::verbose > 0)
721 cout << "Removed " << edges.size() << " small overlap edges.\n";
722 if (!opt::db.empty())
723 addToDb(db, "Edges_removed_small_overlap", edges.size());
724}
725
726/** Output the path overlap graph. */
727static void

Callers 1

buildPathGraphFunction · 0.85

Calls 15

remove_edgesFunction · 0.85
addToDbFunction · 0.85
contigIndexMethod · 0.80
getPathFunction · 0.70
verticesFunction · 0.50
out_degreeFunction · 0.50
out_edgesFunction · 0.50
in_degreeFunction · 0.50
backMethod · 0.45
frontMethod · 0.45
countMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected