How Can I Distinguish Bam File Is Produced By Bwa Or Other Program?
2
3
Entering edit mode
13.0 years ago
Bioscientist ★ 1.7k

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

bwa samtools bam • 3.8k views
ADD COMMENT
11
Entering edit mode
13.0 years ago

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 COMMENT
6
Entering edit mode
13.0 years ago

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 COMMENT
1
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 1803 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6