This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Get Mapping Statistics On Bam File

I have a .BAM file that I have sorted using SAMTools sort command. Now I have to calculate the mapping statistics. I need to know how many total reads are in the BAM file (both mates) and what percentage of the reads are mapped singletons. What command should I use?

samtools

I am closing this question because a quick google search ("bam statistics") reveals several good options. If other admins disagree feel free to reopen.

Really? A simple google search returns nothing for me.

amusing how the past comes back to bite ...

1 answer

Putting it here to have the question answered, originally posted by Varun Gupta

samtools flagstat test.bam

And as Zev.Kronenberg indicates search for the same terms on the search form on the main page of this site you will find many hits.

Dumb question but i am dying to know how to tag names?

no all you need is to just paste the url into the post

Zev.Kronenberg

it recognizes the url and generates the right link. The same works with posts.

Your approach is also correct but takes more work.

I suggest you use command line and some ready made programs for carrying out the statistics of your .bam files. I used BAMstat.py for getting the cross verification of the output generated using the command line.

Log in to answer this question.