Question: how to correct this Error while building index from .bam file?
0
gravatar for jaqx008
2.1 years ago by
jaqx00870
jaqx00870 wrote:

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"

ADD COMMENTlink modified 2.1 years ago • written 2.1 years ago by jaqx00870

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 REPLYlink written 2.1 years ago by Pierre Lindenbaum131k

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 REPLYlink written 2.1 years ago by jaqx00870
0
gravatar for h.mon
2.1 years ago by
h.mon31k
Brazil
h.mon31k wrote:

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

ADD COMMENTlink written 2.1 years ago by h.mon31k

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 REPLYlink written 2.1 years ago by jaqx00870

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

ADD REPLYlink written 2.1 years ago by WouterDeCoster44k

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

ADD REPLYlink written 2.1 years ago by jaqx00870
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1062 users visited in the last hour