wwood / CoverM

Read coverage calculator for metagenomics
GNU General Public License v3.0
275 stars 30 forks source link

BAM file only input resulting in 0 reads mapped? #96

Closed Rob-murphys closed 2 years ago

Rob-murphys commented 2 years ago

I am trying to run the two following commands:

coverm contig -b $outBam -m coverage_histogram -o $outHist
coverm contig -b $outBam -m covered_fraction -o $outFrac 

for which the STDOUT looks the same for both:

[2021-11-18T10:23:32Z INFO  coverm] CoverM version 0.6.1
[2021-11-18T10:23:32Z INFO  coverm] Writing output to file: testFrac.temp
[2021-11-18T10:23:32Z INFO  coverm] Using min-covered-fraction 0%
[2021-11-18T10:23:41Z INFO  coverm::contig] In sample '<sample name>', found 0 reads mapped out of 6791664 total (0.00%)

I get this for every BAM file input I use. The directed output is also showing 0 reads mapped no matter the metric.

Am I allowed to be using just BAM files and if so what is causing the 0 reads mapped?

wwood commented 2 years ago

Hi,

Thanks for your interest.

Right, yes this is caused originally by no reads being seen as mapped. How were the BAM files generated? I assume there are mapped reads and some are marked as primary mappings in samtools flagstat?