MCPcopy Create free account
hub / github.com/OpenGene/fastp / getAdapterReportCount

Method getAdapterReportCount

src/filterresult.cpp:402–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402int FilterResult::getAdapterReportCount(map<string, long, classcomp>& adapterCounts) {
403 map<string, long>::iterator iter;
404 long total = 0;
405 long totalAdapterBases = 0;
406 for(iter = adapterCounts.begin(); iter!=adapterCounts.end(); iter++) {
407 total += iter->second;
408 totalAdapterBases += iter->first.length() * iter->second;
409 }
410 if(total == 0)
411 return 0;
412 const double reportThreshold = 0.01;
413 const double dTotal = (double)total;
414 int count = 0;
415 for(iter = adapterCounts.begin(); iter!=adapterCounts.end(); iter++) {
416 if(iter->second /dTotal < reportThreshold )
417 continue;
418 count++;
419 }
420 return count;
421}
422
423int FilterResult::outputAdaptersHtml(ofstream& ofs, map<string, long, classcomp>& adapterCounts, long totalBases, int limitCount) {
424

Callers

nothing calls this directly

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected