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

Function buildPathGraph

MergePaths/MergePaths.cpp:845–886  ·  view source on GitHub ↗

Build the path overlap graph. */

Source from the content-addressed store, hash-verified

843
844/** Build the path overlap graph. */
845static void
846buildPathGraph(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. */
889static Lengths

Callers 1

mainFunction · 0.85

Calls 15

atomicIncFunction · 0.85
findPathOverlapsFunction · 0.85
ContigNodeClass · 0.85
addMissingEdgesFunction · 0.85
removeTransitiveEdgesFunction · 0.85
removeSmallOverlapsFunction · 0.85
passGraphStatsValFunction · 0.85
addToDbFunction · 0.85
outputPathGraphFunction · 0.85
verticesMethod · 0.80
getFunction · 0.70
remove_vertexFunction · 0.50

Tested by

no test coverage detected