Error in creating BAM index
2
2
Entering edit mode
9.9 years ago
Constantine ▴ 290

Hello

I've created an alignment (SAM and subsequently BAM file) using samtools. However, when I'm trying to create an index out of the BAM file I get the following message:

$ samtools index alignment.new.bam
[E::hts_idx_push] NO_COOR reads not in a single block at the end 15 -1

I have no clue what that means so any help would be much appreciated

Thanks

ChIP-Seq RNA-Seq • 22k views
ADD COMMENT
0
Entering edit mode

Can you paste the commands used for alignment and sam --> bam ?

ADD REPLY
0
Entering edit mode

For the alignment:

$ bowtie2 -p 20 -x mm10 -U SRR1557699_1.fastq.gz -S alignment.new.sam

For Sam -> Bam

$ samtools view -bS alignment.new.sam > alignment.new.bam
ADD REPLY
7
Entering edit mode
9.9 years ago

I cannot tell from the post if you have sorted you bam file. You need to sort bam files before indexing them.

ADD COMMENT
2
Entering edit mode

You've almost certainly identified the problem. The error message is a complaint that the unaligned reads are not at the end of his BAM.

ADD REPLY
0
Entering edit mode

Thanks. That solved the problem :)

ADD REPLY
0
Entering edit mode

So, I am encountering a similar problem.

The message I receive is

[E::hts_idx_push] NO_COOR reads not in a single block at the end 0 -1

However I am not receiving this message for all samples. The script is a loop so all my samples are being treated the same, yet 3 made it through without error and three did not.

Here are my commands for reference.

samtools view -bS -T REFGENOME.fa SAMPLE1.sam > Sample1.bam
samtools sort SAMPLE1.bam SAMPLE1.sorted
samtools index SAMPLE1.sorted.bam

From here the data is passed to picard/GATK

Also just a note, my reference is E. coli so the problem isn't chromosome size limit.

ADD REPLY
2
Entering edit mode
8.6 years ago
ks ▴ 30

Also, the sorted file needs to be coordinate sorted, not by feature name (don't include the -n parameter).

ADD COMMENT

Login before adding your answer.

Traffic: 2309 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