diff --git a/src/crop_unmapped.h b/src/crop_unmapped.h index eea8f3e0455234609abf7beb362a493dafdbaca0..8d4a68aa9be86402bfc517e7cbcf838b263ea14d 100644 --- a/src/crop_unmapped.h +++ b/src/crop_unmapped.h @@ -406,6 +406,7 @@ crop_unmapped(double & avgCov, // Iterate over the input file. BamAlignmentRecord record; + unsigned totalReads = 0; unsigned long alignedBaseCount = 0; while (!atEnd(inStream)) { @@ -416,6 +417,9 @@ crop_unmapped(double & avgCov, if (hasFlagDuplicate(record) or hasFlagSecondary(record) or hasFlagQCNoPass(record) or hasFlagSupplementary(record)) continue; + // Count 'interesting' reads.. + totalReads += 1; + if (!hasFlagUnmapped(record)) alignedBaseCount += length(record.seq); @@ -447,6 +451,10 @@ crop_unmapped(double & avgCov, avgCov = (double)alignedBaseCount / (double)genomeLength; std::ostringstream msg; + msg << "BAM file lists alignments for " << totalReads << " reads after duplicate removal and filtering on QC pass flag."; + printStatus(msg); + + msg.str(""); msg << "Map of low quality mates has " << otherReads.size() << " records."; printStatus(msg);