Originally posted by SamH
View Post
That behaviour is expected and correct. BGZF is just a variant of gzip, once you decompress that you have a 'naked' BAM file which is a binary representation of the SAM format - although as you noticed it does contain an embedded plain text SAM header. All the Biopython Bio.bgzf code did for you was decompress it. Biopython doesn't currently have a BAM parser.
Have you looked at pysam which is a Python wrapper for the samtools
C API? http://code.google.com/p/pysam/
Peter
Leave a comment: