Ecogenomics / BamM

Metagenomics-focused BAM file manipulation
http://ecogenomics.github.io/BamM/
GNU Lesser General Public License v3.0
16 stars 7 forks source link

Only mapped reads stored in bam file #32

Open mdehollander opened 8 years ago

mdehollander commented 8 years ago

Hi,

When I look at the mapping performance with samtools flagstat I always get a value of 100% for the mapped reads. When I use bwa directly in stead of bamm the percentage is more realistic (87%). Looking at the real numbers, you can see that in the bam files produced by bamm only the mapped reads are stored (917688 total reads for bamm versus 917689 reads mapped with bwa). Is it possible to store also the unmapped reads with bamm?

bamm stats

917688 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
134918 + 0 supplementary
0 + 0 duplicates
917688 + 0 mapped (100.00%:-nan%)
782770 + 0 paired in sequencing
396083 + 0 read1
386687 + 0 read2
620168 + 0 properly paired (79.23%:-nan%)
755826 + 0 with itself and mate mapped
26944 + 0 singletons (3.44%:-nan%)
134780 + 0 with mate mapped to a different chr
61196 + 0 with mate mapped to a different chr (mapQ>=5)

bwa stats

1044390 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
134918 + 0 supplementary
0 + 0 duplicates
917689 + 0 mapped (87.87%:-nan%)
909472 + 0 paired in sequencing
454736 + 0 read1
454736 + 0 read2
620172 + 0 properly paired (68.19%:-nan%)
755830 + 0 with itself and mate mapped
26941 + 0 singletons (2.96%:-nan%)
134778 + 0 with mate mapped to a different chr
61196 + 0 with mate mapped to a different chr (mapQ>=5)
timbalam commented 8 years ago

Hey mdehollander,

Thanks for using bamm, and for the suggestion! Someone recently requested pretty much this idea. I have a -keep_unmapped flag for bamm make implemented in a local branch. There's just a couple of things to take care of before we can merge it. I'll aim to get it done early next week.

Regards, Tim

mdehollander commented 8 years ago

nice! looking forward to see this in the master branch :) thanks!

timbalam commented 8 years ago

Hey mdehollander,

The new features are in the master branch, and we've made a new release v1.7.0. Let me know if you have any issues!

Cheers, Tim