Output the updated overlap graph. */
| 386 | |
| 387 | /** Output the updated overlap graph. */ |
| 388 | static void |
| 389 | outputGraph( |
| 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 | |
| 434 | int |
| 435 | main(int argc, char** argv) |
no test coverage detected