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

Function outputGraph

MergePaths/MergeContigs.cpp:388–432  ·  view source on GitHub ↗

Output the updated overlap graph. */

Source from the content-addressed store, hash-verified

386
387/** Output the updated overlap graph. */
388static void
389outputGraph(
390 Graph& g,
391 const vector<string>& pathIDs,
392 const ContigPaths& paths,
393 const string& commandLine)
394{
395 typedef graph_traits<Graph>::vertex_descriptor V;
396
397 // Add the path vertices.
398 g_contigNames.unlock();
399 for (ContigPaths::const_iterator it = paths.begin(); it != paths.end(); ++it) {
400 const ContigPath& path = *it;
401 const string& id = pathIDs[it - paths.begin()];
402 if (!path.empty()) {
403 V u = merge(g, path.begin(), path.end());
404 put(vertex_name, g, u, id);
405 }
406 }
407 g_contigNames.lock();
408
409 // Remove the vertices that are used in paths.
410 for (ContigPaths::const_iterator it = paths.begin(); it != paths.end(); ++it) {
411 const ContigPath& path = *it;
412 const string& id = pathIDs[it - paths.begin()];
413 if (path.empty()) {
414 remove_vertex(find_vertex(id, false, g), g);
415 } else {
416 remove_vertex_if(
417 g, path.begin(), path.end(), [](const ContigNode& c) { return !c.ambiguous(); });
418 }
419 }
420
421 // Output the graph.
422 const string& graphPath = opt::graphPath;
423 assert(!graphPath.empty());
424 if (opt::verbose > 0)
425 cerr << "Writing `" << graphPath << "'..." << endl;
426 ofstream fout(graphPath.c_str());
427 assert_good(fout, graphPath);
428 write_graph(fout, g, PROGRAM, commandLine);
429 assert_good(fout, graphPath);
430 if (opt::verbose > 0)
431 printGraphStats(cerr, g);
432}
433
434int
435main(int argc, char** argv)

Callers 1

mainFunction · 0.70

Calls 14

remove_vertex_ifFunction · 0.85
assert_goodFunction · 0.85
write_graphFunction · 0.85
unlockMethod · 0.80
lockMethod · 0.80
ambiguousMethod · 0.80
mergeFunction · 0.50
putFunction · 0.50
remove_vertexFunction · 0.50
find_vertexFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected