problem with loading .bam file

1,218 views
Skip to first unread message

aschaefe

unread,
Apr 15, 2016, 10:15:26 AM4/15/16
to igv-help
Hi,

I am doing my peak calling for ChIP-seq with CLC Genome Workbench but would like to visualize peak counts with IGV-
exporting my files from CLC as bam files and convert them into tdf files using the IGV tools;
however, when I upload the tdf file I am receiving the following error message:

A10_K27.bam.tdf
Error reading header: bad magic number.

any suggestions/help/etc. will be more then appreciated!

Jim Robinson

unread,
Apr 15, 2016, 12:03:46 PM4/15/16
to igv-...@googlegroups.com
Hi,

A few questions

What version of IGV and igvtools are you using?

If you using the command line to compute the coverage (counts) please post the full command you used.

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/9f4f3fc5-8fa4-4e2d-b9db-7afa072eebcc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexandra Schaefer

unread,
Apr 15, 2016, 12:30:20 PM4/15/16
to igv-...@googlegroups.com
Hi Jim,

just downloaded IGV and igvtools yesterday-
it's IGV_2.3.72 2 and igvtools_2.3.72
I did not use the command line

Thanks,
Alex



--

---
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/0IPqr4Or1WA/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/571110DD.3010700%40broadinstitute.org.

Jim Robinson

unread,
Apr 15, 2016, 12:37:03 PM4/15/16
to igv-...@googlegroups.com
OK, which command from the pulldown did you use to create the tdf?

Alexandra Schaefer

unread,
Apr 15, 2016, 12:40:18 PM4/15/16
to igv-...@googlegroups.com
Yes, used the command 'count', used the above file as input and got a .bam.tdf as output,
which I tried to load into IVG

Jim Robinson

unread,
Apr 15, 2016, 12:42:11 PM4/15/16
to igv-...@googlegroups.com
Did you wait for the calculation to complete?  Depending on the bam size this can take several hours.   Operations on large files such as most bams are best performed on the command line,  the UI will work but you will have to leave the IGV window open until you see 100.0% Done in the tools message window.   The message indicates the TDF file is corrupt,  this is the most common cause.

If you continue to have this problem I suggest you download igvtools and do this on the command line.

Jim

Alexandra Schaefer

unread,
Apr 15, 2016, 12:46:51 PM4/15/16
to igv-...@googlegroups.com
Hi Jim,

when I load the file into the tools and run it, I get the following status report:

tsjdk.samtools.SAMFormatException: Error parsing text SAM file. Not enough fields; Desktop/chip-seq/chr11_mers/A10_K27.bam; Line 1
Line: +�#� A10_K27.bam�o�V �G#     NC_000011 B
    at htsjdk.samtools.SAMLineParser.reportFatalErrorParsingLine(SAMLineParser.java:432)
    at htsjdk.samtools.SAMLineParser.parseLine(SAMLineParser.java:217)
    at htsjdk.samtools.SAMTextReader$RecordIterator.parseLine(SAMTextReader.java:248)
    at htsjdk.samtools.SAMTextReader$RecordIterator.next(SAMTextReader.java:236)
    at htsjdk.samtools.SAMTextReader$RecordIterator.next(SAMTextReader.java:212)
    at htsjdk.samtools.SamReader$AssertingIterator.next(SamReader.java:544)
    at htsjdk.samtools.SamReader$AssertingIterator.next(SamReader.java:518)
    at org.broad.igv.sam.reader.WrappedIterator.next(WrappedIterator.java:53)
    at org.broad.igv.sam.reader.WrappedIterator.next(WrappedIterator.java:36)
    at org.broad.igv.tools.CoverageCounter.parse(CoverageCounter.java:307)
    at org.broad.igv.tools.IgvTools.doCount(IgvTools.java:865)
    at org.broad.igv.tools.IgvToolsGui$13.doInBackground(IgvToolsGui.java:475)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at javax.swing.SwingWorker.run(SwingWorker.java:334)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
100.0%
Done

anything i can do different here?



Jim Robinson

unread,
Apr 15, 2016, 12:50:53 PM4/15/16
to igv-...@googlegroups.com
There's something not right about your bam file.  First the htsjdk library thinks its an ascii SAM file.    Have you successfully used this bam file with other tools?   Do you have access to samtools, or Picard?

Jim

Alexandra Schaefer

unread,
Apr 15, 2016, 12:53:23 PM4/15/16
to igv-...@googlegroups.com
used it with Partek-
nope don't have either one


Jim Robinson

unread,
Apr 15, 2016, 12:58:39 PM4/15/16
to igv-...@googlegroups.com
If you can make it available, or create a small one you can send me,  I will probe it and see if I can figure out the problem.   However from the error message it doesn't appear to be a standard "bam" file.    I know nothing of the tool that produced it,  so really can't be of much help.   Another resource is the GATK forum,  they support the BAM reading library that we use:  http://gatkforums.broadinstitute.org/gatk.

Jim

Alexandra Schaefer

unread,
Apr 15, 2016, 1:53:36 PM4/15/16
to igv-...@googlegroups.com
HI Jim,

found this on the CLC Workbench homepage:

BAM format files exported from CLC software are not sorted nor indexed

they also suggest samtools to sort and index them....

could this solve the problem?



Jim Robinson

unread,
Apr 15, 2016, 1:56:11 PM4/15/16
to igv-...@googlegroups.com
Possibly, it would at least give you more information.  I definitely would recommend it,  samtools is the default reference standard for dealing with BAM files.    The error you displayed implies more problems than just an unsorted file,  but trying with samtools would be a start.

Jim
Reply all
Reply to author
Forward
0 new messages