Error encountered querying alignments: htsjdk.samtools.SAMFormatException: Invalid GZIP header

2,769 views
Skip to first unread message

Sakura Nussbaum

unread,
Mar 6, 2016, 9:25:45 PM3/6/16
to igv-help
Hello igv-help people,

I am not very familiar with IGV yet, but I have some trouble opening bam files.
  1. I am using IVG 2.3.68 (and Java 8 Update 73)
  2. I try to open bam files and to zoom (as I am asked to do).
  3. I expect IVG to display my data, as it is on my colleague's laptop 
  4. I got the following error message:  Error encountered querying alignments: htsjdk.samtools.SAMFormatException: Invalid GZIP header
Does someone know what could be the problem?

Cheers

Sakura Nussbaum

unread,
Mar 6, 2016, 9:45:51 PM3/6/16
to igv-help
I also get this error message sometimes:  Error encountered querying alignments: java.lang.NullPointerException

Sakura Nussbaum

unread,
Mar 6, 2016, 9:57:10 PM3/6/16
to igv-help
I tried to uninstall and install IGV again, but it is the same problem. I attached my igv.log file


Le lundi 7 mars 2016 11:25:45 UTC+9, Sakura Nussbaum a écrit :
igv.log

Jim Robinson

unread,
Mar 6, 2016, 11:29:21 PM3/6/16
to igv-...@googlegroups.com
The most likely cause is an invalid index for the BAM file.   It could also be a corrupt file.   Are you able to use this file with other tools,  for example "samtools view",  in the same genomic region as you encountered the error?

Jim
--

---
You received this message because you are subscribed to the Google Groups "igv-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to igv-help+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/43f62427-636a-4f38-ae06-74e8b36b9e33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sakura Nussbaum

unread,
Mar 6, 2016, 11:52:54 PM3/6/16
to igv-help
It was indeed an index problem! I used the samtools index command and it worked. I don't understand how it really works yet, but I guess I will learn little by little.

Thank you very much Jim!

majidm...@gmail.com

unread,
Nov 29, 2018, 2:57:47 PM11/29/18
to igv-help
Dear james
I have same problem!
I can use my bam file with samtools view
also I can use my bam file in other samtools command for variant calling
can u help me?

در دوشنبه 7 مارس 2016، ساعت 7:59:21 (UTC+3:30)، James Robinson نوشته:

James Robinson

unread,
Nov 29, 2018, 3:01:39 PM11/29/18
to igv-...@googlegroups.com
If it really is the same problem you can fix it by recomputing the index with samtools.     Sorry I can't really answer questions about variant calling,  perhaps ask on biostars or seqanswers.

majid mojarrad

unread,
Nov 29, 2018, 3:08:22 PM11/29/18
to igv-...@googlegroups.com
Dear James
i recompute it with samtools but problem is still repeat.

--

---
You received this message because you are subscribed to a topic in the Google Groups "igv-help" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/igv-help/3afBAUYtepg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to igv-help+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/CACOP%2BptZdVtjEY76Qdbie589e7%2BR%3D%3DOXNXTLK67rBVHvLS7z%2BQ%40mail.gmail.com.

majid mojarrad

unread,
Nov 29, 2018, 3:09:29 PM11/29/18
to igv-...@googlegroups.com
i use several bam file but all of them can not visualized by igv 

majid mojarrad

unread,
Nov 29, 2018, 3:14:56 PM11/29/18
to igv-...@googlegroups.com
i use this commands
>samtools view -bS test.sam -o test.bam
>samtools sort test.bam test.sorted
>samtools index test.sorted.bam test.sorted.bam.bai
and use file (test.bam) in IGV
but it give error 
what can i do?

James Robinson

unread,
Nov 29, 2018, 3:18:05 PM11/29/18
to igv-...@googlegroups.com
That is the correct procedure,  so I'm not really sure what the problem is.    If you can provide a test case I will look into it,  I will need the bam file and possibly the fasta file if its not one we host.

When making a bug report please include the IGV version number,  and your igv.log file.   

You received this message because you are subscribed to the Google Groups "igv-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to igv-help+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/CALE5XTdQX3DQ-jcH6qzQ%3D1tg1xUT1bY4OBhKxNYGaLLPbyRwYw%40mail.gmail.com.

James Robinson

unread,
Nov 29, 2018, 3:24:08 PM11/29/18
to igv-...@googlegroups.com
Hi,

Sorry I missed this before.  But are you loading "test.bam"?   That is not going to work,  given your sequence of commands you should load  "test.sorted.bam".    I assume you just misstyped and meant to type "test.sorted.bam".

You received this message because you are subscribed to the Google Groups "igv-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to igv-help+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/CALE5XTdQX3DQ-jcH6qzQ%3D1tg1xUT1bY4OBhKxNYGaLLPbyRwYw%40mail.gmail.com.

majid mojarrad

unread,
Nov 29, 2018, 4:07:59 PM11/29/18
to igv-...@googlegroups.com
hi 
i realy do this mistake😑
i load test.sorted.bam and this work
thank u very much indeed


Reply all
Reply to author
Forward
0 new messages