Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bam and Sam don't like my fasta file mindlessbrain Bioinformatics 2 12-09-2010 10:47 PM
Why do we use mapping programs instead of blast for mapping to a reference? thsuk1 Bioinformatics 6 08-27-2010 08:54 AM
MAQ's mapview format to binary map format baohua100 Bioinformatics 3 08-06-2010 01:12 AM
can mapview format convert to map format of MAQ chenw Illumina/Solexa 4 07-24-2009 11:28 PM
Help convert maq map format to eland format hard998 Bioinformatics 0 07-20-2009 07:37 PM

Thread Tools
Old 11-02-2011, 01:33 PM   #1
Senior Member
Location: USA

Join Date: Jan 2011
Posts: 105
Default Why don't mapping programs map directly into BAM format?

Is this historical contingency? Or is there a functional reason why mapping programs like BWA or Stampy don't map directly to BAM?
oiiio is offline   Reply With Quote
Old 11-02-2011, 03:43 PM   #2
Senior Member
Location: Boston

Join Date: Feb 2008
Posts: 693

1) because writing BAM is non-trivial and no one wants to add a dependency only for writing BAM

2) because you can easily generate BAM by piping the output to samtools
lh3 is offline   Reply With Quote
Old 11-02-2011, 04:06 PM   #3
Super Moderator
Location: US

Join Date: Nov 2009
Posts: 437

But assuming it was trivial, is there a good reason to output to SAM. Seems like all downstream operations would be BAM-based anyways?
adaptivegenome is offline   Reply With Quote
Old 11-03-2011, 12:36 AM   #4
Simon Andrews
Location: Babraham Inst, Cambridge, UK

Join Date: May 2009
Posts: 871

When mapping sequences each sequence is handled independently and the mapping program just wants to write this to the output file and move on (even more so when running multiple threads).

Many people who want to use BAM files want to have indexed files which allow for efficient random access. Because the files need to be sorted the output needs to be post-processed after all of the mapping is done, you can't just write them out as you go along. Mapping programs would therefore still have to write out SAM files as they went along and then convert these to BAM at the end. Since you can easily do this with a samtools command the mapping programs generally don't bother to do this and leave it up to the user.
simonandrews is offline   Reply With Quote
Old 11-03-2011, 04:01 AM   #5
Peter (Biopython etc)
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,543

Indeed. Or to put it another way,

Output of unsorted SAM is easy.

Output of pre-sorted SAM/BAM is hard.

Since you (or the tool) will have to do a SAM/BAM coordinate sorting step anyway, you might as well do the unsorted SAM to sorted BAM in one go with samtools.
maubp is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 02:17 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO