Remove contigs with insufficient coverage. */
| 501 | |
| 502 | /** Remove contigs with insufficient coverage. */ |
| 503 | static void |
| 504 | filterGraph(Graph& g) |
| 505 | { |
| 506 | typedef graph_traits<Graph> GTraits; |
| 507 | typedef GTraits::vertex_descriptor V; |
| 508 | typedef GTraits::vertex_iterator Vit; |
| 509 | |
| 510 | unsigned removedContigs = 0, removedKmer = 0; |
| 511 | std::pair<Vit, Vit> urange = vertices(g); |
| 512 | for (Vit uit = urange.first; uit != urange.second; ++uit) { |
| 513 | V u = *uit; |
| 514 | if (get(vertex_removed, g, u)) |
| 515 | continue; |
| 516 | const ContigProperties& vp = g[u]; |
| 517 | if (getMeanCoverage(vp) < opt::minCoverage) { |
| 518 | removedContigs++; |
| 519 | removedKmer += getKmerLength(vp); |
| 520 | clear_vertex(u, g); |
| 521 | remove_vertex(u, g); |
| 522 | g_popped.push_back(get(vertex_contig_index, g, u)); |
| 523 | } |
| 524 | } |
| 525 | if (opt::verbose > 0) { |
| 526 | cerr << "Removed " << removedKmer << " k-mer in " << removedContigs |
| 527 | << " contigs with mean k-mer coverage " |
| 528 | "less than " |
| 529 | << opt::minCoverage << ".\n"; |
| 530 | printGraphStats(cerr, g); |
| 531 | } |
| 532 | } |
| 533 | |
| 534 | /** Remove the specified contig from the adjacency graph. */ |
| 535 | static void |
no test coverage detected