I'm running into a problem with HTSeq that I can't seem to solve on my own:
As running through the entire bam file to find alignments corresponding to a genomic position (from a gtf file) works, but takes a long time, I'm trying to use the indexed random access approach. Code is identical (except filenames and window postitions) to the docs tutorial for HTSeq, and my input file is a coordinate-sorted bam file with index file of the same name (but with .bai extension of course) in same folder as sorted bam file. Bam file was sorted with Picard Tools if that matters. After attempting to run the code below, I get the following error:
sortedbam = \
HTSeq.BAM_Reader("729_GCCAAT_L007_R1_001_trimmed.sorted.bam")
for alnmt in sortedbam[ window ]:
print alnmt
ERROR: ValueError: The .bam-file has no index, random-access is disabled!
The index filename is 729_GCCAAT_L007_R1_001_trimmed.sorted.bai
I'm stumped.
For what it's worth, htseq_count and dexseq_count both work fine (obviously fewer chances to screw something up passing arguments to a script but I wanted to mention it).
As running through the entire bam file to find alignments corresponding to a genomic position (from a gtf file) works, but takes a long time, I'm trying to use the indexed random access approach. Code is identical (except filenames and window postitions) to the docs tutorial for HTSeq, and my input file is a coordinate-sorted bam file with index file of the same name (but with .bai extension of course) in same folder as sorted bam file. Bam file was sorted with Picard Tools if that matters. After attempting to run the code below, I get the following error:
sortedbam = \
HTSeq.BAM_Reader("729_GCCAAT_L007_R1_001_trimmed.sorted.bam")
for alnmt in sortedbam[ window ]:
print alnmt
ERROR: ValueError: The .bam-file has no index, random-access is disabled!
The index filename is 729_GCCAAT_L007_R1_001_trimmed.sorted.bai
I'm stumped.
For what it's worth, htseq_count and dexseq_count both work fine (obviously fewer chances to screw something up passing arguments to a script but I wanted to mention it).
Comment