Entering edit mode
11.4 years ago
loic.laureote
▴
20
hi, I tried to read a .bam file, by uncompress the file with bgzf module provided by biopython but only some indexed parts are readable. I saw that the file is build by different compressed block, but how to read it with biopython ?
from Bio import SeqIO
import gzip
from Bio import bgzf
import struct
import gzip
handle = bgzf.BgzfReader("Example.bam", "r")
print handle.read(100)
Thanks for your help !!
Why not use pysam?
pysam is a python wrapper of samtools
Sure, but I guess I meant to ask if there's a specific reason you don't want to use samtools (even if wrapped in python).
there is not easy way to install it on windows.