how to correct this Error while building index from .bam file?
1
0
Entering edit mode
5.5 years ago
jaqx008 ▴ 110

Hello all,

I encountered an error while trying to make index for a bam file. How do I correct it? by the way, my bam was generated from sam after mapping with bowtied2. Thanks

samtools index file.bam

[E::hts_idx_push] NO_COOR reads not in a single block at the end 38 -1
samtools index: failed to create index for "file.bam"
bam samtools • 1.5k views
ADD COMMENT
0
Entering edit mode

validate your bam file.

what is the output of samtools view -c file.bam ?

if there is an error, it doesn't come from index but from your upstream workflow.

ADD REPLY
0
Entering edit mode

Thanks for your response, the problem was I did not sort the bam. I sorted it now and I dont get the error anymore. Thank you

ADD REPLY
0
Entering edit mode
5.5 years ago
h.mon 35k

Did you sort the bam file? What was the command used to create the bam file?

ADD COMMENT
0
Entering edit mode

Oh. I did not sort it. I am sorting it now so I can make index off the sorted file. I think that should work.

ADD REPLY
0
Entering edit mode

Are you using a very old version of samtools? I'd expect a more explicit error message.

ADD REPLY
0
Entering edit mode

Thank you, this was my mistake, Its good now. again thanks

ADD REPLY

Login before adding your answer.

Traffic: 2089 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6