Question: How To Generate Alignment Statistics Report?
9
gravatar for Angel
7.1 years ago by
Angel210
United States
Angel210 wrote:

Hey Huys,

How can I generate an alignment statistics report from bwa or samtools? I used bwa for alignment and samtools for the rest. Any other tool to be used once I generate the bam file? I basically want fields like below generated from a commercial software.

MeanInsertSize

Total read#

Uniquely paired read#

Non-uniquely paired read#

Uniquely mapped read1#

Non-uniquely mapped read1#

Uniquely mapped read2#

Non-uniquely mapped read2#

Unmapped read1#

Unmapped read2#

Uniquely paired read%

Non-uniquely paired read%

Uniquely mapped read1%

Non-uniquely mapped read1%

Uniquely mapped read2%

Non-uniquely mapped read2%

Unmapped read1%

Unmapped read2%

exome bwa • 16k views
ADD COMMENTlink modified 7.0 years ago by Matt Shirley8.9k • written 7.1 years ago by Angel210

http://biostar.stackexchange.com/questions/9552/basic-bam-file-annotation

ADD REPLYlink written 7.1 years ago by Jeremy Leipzig18k
7
gravatar for Matt Shirley
7.1 years ago by
Matt Shirley8.9k
Cambridge, MA
Matt Shirley8.9k wrote:

I think what you want can be achieved using Picard, which is an implementation of Samtools, but in Java. There are also a few tools in Picard which are absent in Samtools. Namely, you want to use CollectAlignmentSummaryMetrics. http://picard.sourceforge.net/javadoc/net/sf/picard/analysis/CollectAlignmentSummaryMetrics.html

You can run this on your SAM/BAM, and you will have most of what you describe above.

EDIT: If you have memory issues, you can increase / decrease the amount of memory available to the program using these flags: "-vmargs -Xms###[mg] -Xmx###[mg]"

java jvm-args -jar PicardCommand.jar

becomes

java -vmargs -Xms64m -Xmx4000m -jar PicardCommand.jar

The first Xms is the minimum amount of memory available to the program when it starts, and the second Xmx is the max memory limit. You can specify the amount of memory using either megabytes (m) or gigabytes (g).

ADD COMMENTlink modified 7.1 years ago • written 7.1 years ago by Matt Shirley8.9k

Thanks so much for your reply. I tried Picard for something else, and it just keeps complaining about the memory. Not happy with the program. But I will try again as you suggested for metrics, may be will work.

ADD REPLYlink written 7.1 years ago by Angel210

@Angel have you tried increasing your initial memory size ? that might help

ADD REPLYlink written 7.1 years ago by Sudeep1.6k

Please see new post as I could not fit everything as a comment to this post:

http://biostar.stackexchange.com/questions/17456/output-from-picard-and-samtools-flagstat-not-very-useful-from-my-sambam-files

ADD REPLYlink written 7.1 years ago by Angel210

Hi Sudeep, could you recommend how to increase memory you are referring to?

ADD REPLYlink written 7.1 years ago by Angel210

Edited my original answer to include information about increasing initial memory available to a java app.

ADD REPLYlink written 7.1 years ago by Matt Shirley8.9k
3
gravatar for Damian Kao
7.1 years ago by
Damian Kao15k
USA
Damian Kao15k wrote:

You can use samtools flagstat command to generate some of those statistics. Here is an old BioStar question about how to interpret the flagstat output.

ADD COMMENTlink written 7.1 years ago by Damian Kao15k

Thanks very much, will try it today.

ADD REPLYlink written 7.1 years ago by Angel210
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1249 users visited in the last hour