[emboss-dev] Inconsistency in SAM vs BAM read description
biopython at maubp.freeserve.co.uk
Mon Aug 2 16:42:07 UTC 2010
On Mon, Aug 2, 2010 at 5:26 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
> Hi all,
> After patching the following two issues,
> there is a noticeable difference in the output from the SAM and BAM
> parsers in the description of the reads:
> $ seqret -sformat bam -osformat fasta ex1.bam -stdout -auto | head
> $ seqret -sformat sam -osformat fasta ex1.sam -stdout -auto | head
> As you can see from the above example (using files described in
> the linked threads), when parsing SAM files if the read is mapped
> then the reference sequence name is used as the description.
> This seems like a sensible and useful thing to do. However, when
> parsing BAM files this is not currently being done.
> Having the SAM and BAM parser produce identical results is
> very useful for testing purposes (e.g. running diff on their output
> as FASTQ format), so I would like the BAM parser to do the same.
> Looking at the source, function seqReadSam in ajax/core/ajseqread.c
> does this with the reference name string:
> ajStrTokenNextParseNoskip(&handle,&token); /* RNAME */
> ajDebug("RNAME '%S'\n", token);
> seqAccSave(thys, token);
Just as a post script,
Having failed to enhance the BAM parser, for short term testing
I'm just commenting out the above two lines of the SAM parser.
With that trivial change, then the FASTA and FASTQ output
from both the SAM and BAM files agrees 100% (as you would
More information about the emboss-dev