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. */
| 690 | * overlap of (u,v) is small. |
| 691 | */ |
| 692 | static void |
| 693 | removeSmallOverlaps(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. */ |
| 727 | static void |
no test coverage detected