Question: How Can I Distinguish Bam File Is Produced By Bwa Or Other Program?
3
gravatar for Bioscientist
8.2 years ago by
Bioscientist1.7k
Bioscientist1.7k wrote:

I've got some bam files from other people. Because I've only tried BWA (not bowtie or other things) so I just take it for granted that it's produced by BWA.

Now I highly doubt if it's produced by BWA. I'm just wondering is there any way to check if bam file is produced by BWA or other programs? (say use samtools view?)

Thanks

bam samtools bwa • 2.0k views
ADD COMMENTlink written 8.2 years ago by Bioscientist1.7k
11
gravatar for Brad Chapman
8.2 years ago by
Brad Chapman9.5k
Boston, MA
Brad Chapman9.5k wrote:

The @PG tag in the header will tell you this:

$ samtools view -H your_file.bam | grep PG
@PG ID:bowtie2  PN:bowtie2  VN:2.0.0-beta3

The SAM specification is a great resource for details:

http://samtools.sourceforge.net/SAM1.pdf

ADD COMMENTlink written 8.2 years ago by Brad Chapman9.5k
5
gravatar for Damian Kao
8.2 years ago by
Damian Kao15k
USA
Damian Kao15k wrote:

There is no requirements in the SAM format headers to display the mapping program used. You might be able to guess what mapping program was used by looking at the optional fields in each SAM mapping line.

If you look at the manuals for bowtie (http://bowtie-bio.sourceforge.net/manual.shtml) and bwa (http://bio-bwa.sourceforge.net/bwa.shtml).

Bowtie can optionally generate: NM CM MD XA XM

BWA can optionally generate: NM MD AS BC X0 X1 XN XM XO XG XT XA XS XF XE

You can see if there are any BWA specific fields in your sAM entries. But it's kind of a hack honestly.

edit*** nevermind, Brad has the answer :)

ADD COMMENTlink modified 4 months ago by RamRS25k • written 8.2 years ago by Damian Kao15k

fwiw, I marked this reply as helpful because the @PG tags are optional, and you give some good suggestions of what to look for if the info is not in the bam header.

ADD REPLYlink written 8.2 years ago by Nina360
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: 1376 users visited in the last hour