Question: IGV error: Error loading SAM header: For sequence 34711, text and binary have different lengths in file.
0
gravatar for EVR
23 months ago by
EVR540
Earth
EVR540 wrote:

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

igv rna-seq bam • 1.2k views
ADD COMMENTlink modified 23 months ago by dyollluap300 • written 23 months ago by EVR540
1

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 REPLYlink modified 23 months ago • written 23 months ago by Pierre Lindenbaum120k

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 REPLYlink written 23 months ago by EVR540

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 REPLYlink written 23 months ago by WouterDeCoster39k
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 REPLYlink written 23 months ago by EVR540
1
gravatar for dyollluap
23 months ago by
dyollluap300
USA, California, Bay Area
dyollluap300 wrote:

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 COMMENTlink written 23 months ago by dyollluap300
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: 1092 users visited in the last hour