This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem on indexing of sorted BAM file

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

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

gunzip -t ~/Desktop/Ruelliasorted.sorted.BAM && echo OK

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

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

[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

0 answers

No answers yet.

Log in to answer this question.