Question: Problem on indexing of sorted BAM file
0
gravatar for Gaurab2017
22 months ago by
Gaurab20170
Gaurab20170 wrote:

Hi,

I have a problem with indexing the sorted BAM file in bwa alignment. I gave the command like this

samtools index ~/Desktop/Ruelliasorted.sorted.BAM

and says that

EOF marker is absent. The input is probably truncated.
[bam_header_read] invalid BAM binary header (this is not a BAM file).
[bam_index_core] Invalid BAM header.[bam_index_build2] fail to index the BAM file.

I need help to figure it out. Anybody out there? Thanks in advance

bwa • 1.1k views
ADD COMMENTlink modified 22 months ago by RamRS23k • written 22 months ago by Gaurab20170
1

your file Ruelliasorted.sorted.BAM is broken. you can test this with:

gunzip -t ~/Desktop/Ruelliasorted.sorted.BAM && echo OK
ADD REPLYlink modified 22 months ago • written 22 months ago by Pierre Lindenbaum122k

Thanks Pierre So, do I have to re-sort it or anything else?

ADD REPLYlink written 22 months ago by Gaurab20170
1

There was something wrong with the way you have generated your bam. I don't know your workflow. Re-generate your bam.

ADD REPLYlink written 22 months ago by Pierre Lindenbaum122k
1

[bam_header_read] invalid BAM binary header (this is not a BAM file).

As the log said you have to check wether your file is realy a bam file. How did you generate it? As you tagged this post with bwa: The output of bwa is sam and not bam. For converting you can use

samtools view -b alignment.sam > alignment.bam

fin swimmer

ADD REPLYlink written 22 months ago by finswimmer12k
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: 1807 users visited in the last hour