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

Function filterGraph

PopBubbles/PopBubbles.cpp:503–532  ·  view source on GitHub ↗

Remove contigs with insufficient coverage. */

Source from the content-addressed store, hash-verified

501
502/** Remove contigs with insufficient coverage. */
503static void
504filterGraph(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. */
535static void

Callers 1

mainFunction · 0.70

Calls 7

getMeanCoverageFunction · 0.85
getKmerLengthFunction · 0.85
verticesFunction · 0.50
getFunction · 0.50
clear_vertexFunction · 0.50
remove_vertexFunction · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected