Build the path overlap graph. */
| 843 | |
| 844 | /** Build the path overlap graph. */ |
| 845 | static void |
| 846 | buildPathGraph(const Lengths& lengths, PathGraph& g, const ContigPathMap& paths) |
| 847 | { |
| 848 | // Create the vertices of the path overlap graph. |
| 849 | PathGraph(lengths.size()).swap(g); |
| 850 | |
| 851 | // Remove the non-seed contigs. |
| 852 | typedef graph_traits<PathGraph>::vertex_iterator vertex_iterator; |
| 853 | pair<vertex_iterator, vertex_iterator> vit = g.vertices(); |
| 854 | for (vertex_iterator u = vit.first; u != vit.second; ++u) |
| 855 | if (paths.count(get(vertex_contig_index, g, *u)) == 0) |
| 856 | remove_vertex(*u, g); |
| 857 | |
| 858 | // Find the overlapping paths. |
| 859 | ContigPathMap::const_iterator sharedIt = paths.begin(); |
| 860 | #pragma omp parallel |
| 861 | for (ContigPathMap::const_iterator it; atomicInc(sharedIt, paths.end(), it);) |
| 862 | findPathOverlaps(lengths, paths, ContigNode(it->first, false), it->second, g); |
| 863 | if (gDebugPrint) |
| 864 | cout << '\n'; |
| 865 | |
| 866 | addMissingEdges(lengths, g, paths); |
| 867 | removeTransitiveEdges(g); |
| 868 | removeSmallOverlaps(g, paths); |
| 869 | if (opt::verbose > 0) |
| 870 | printGraphStats(cout, g); |
| 871 | |
| 872 | // graph statistics |
| 873 | vector<int> vals = passGraphStatsVal(g); |
| 874 | vector<string> keys = make_vector<string>() << "V" |
| 875 | << "E" |
| 876 | << "degree0pctg" |
| 877 | << "degree1pctg" |
| 878 | << "degree234pctg" |
| 879 | << "degree5pctg" |
| 880 | << "degree_max"; |
| 881 | if (!opt::db.empty()) { |
| 882 | for (unsigned i = 0; i < vals.size(); i++) |
| 883 | addToDb(db, keys[i], vals[i]); |
| 884 | } |
| 885 | outputPathGraph(g); |
| 886 | } |
| 887 | |
| 888 | /** Read contig lengths. */ |
| 889 | static Lengths |
no test coverage detected