IGV error: Error loading SAM header: For sequence 34711, text and binary have different lengths in file.
1
0
Entering edit mode
7.4 years ago
EVR ▴ 610

HI,

I have sam file and I converted into a bam and later sorted it. I also created bam index for the sorted_bam file. When I am trying to load the bam files into IGV, I am getting the following error:

Error loading SAM header: For sequence 34711, text and binary have different lengths in file.

Can I anyone guide me why the error is popping out.

Thanks in advance

RNA-Seq BAM IGV • 3.4k views
ADD COMMENT
1
Entering edit mode

error is here: https://github.com/samtools/htsjdk/blob/master/src/main/java/htsjdk/samtools/BAMFileReader.java#L686

it happens when you have a difference between the chromosome/contig associated to your read, and what was defined in the SAM header. Did you re-header something ?

ADD REPLY
0
Entering edit mode

All i did was mapping the reads onto transcriptome and obtained a sam file which is later converted into bam as I shown below. Is there any way to look which transcript_Id/Contig_Id got corrupted? or should I have to remap

ADD REPLY
0
Entering edit mode

I have sam file and I converted into a bam and later sorted it. I also created bam index for the sorted_bam file.

Please be as complete as possible and add the following:

  • the commands you used for sam -> bam, sorting and indexing
  • Your version of samtools and igv
ADD REPLY
0
Entering edit mode
My samtools version : 1.3
My IGV version: 2.3.97

Command for converting sam to bam file:

samtools view --threads 40 -F 4 -bS -o mySample.bam -O bam mySample.sam

Command for sorting:

samtools sort --threads 40 -o Sorted_mySamlpe.bam -O bam mySample.bam

Command for indexing:

samtools index mySample.bam

ADD REPLY
1
Entering edit mode
7.4 years ago
dyollluap ▴ 310

Usually I see that different lengths in file error when different versions of the reference assembly have been used in whatever process is being performed. In this case, if the reference.fa you used for building a bam index is different from the original sam alignment, you get this error.

ADD COMMENT

Login before adding your answer.

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