Heads up:
We’re moving the GATK website, docs and forum to a new platform. Read the full story and breakdown of key changes on this blog.
Notice:
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.We appreciate your help!

Test-drive the GATK tools and Best Practices pipelines on Terra


Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.
Attention:
We will be out of the office for a Broad Institute event from Dec 10th to Dec 11th 2019. We will be back to monitor the GATK forum on Dec 12th 2019. In the meantime we encourage you to help out other community members with their queries.
Thank you for your patience!

RealignerTargetCreator htsjdk.tribble.index.IndexFactory.loadIndex exception

tedtoaltedtoal Member
edited July 2017 in Ask the GATK team

I'm getting a tribble loadIndex exception from RealignerTargetCreator. I see this exception has been reported quite a bit, and one cause seems to be out-of-date index file. I deleted the .bai then recreated it with samtools index, and still got the error. Then I tried deleting it without recreating it, since apparently RealignerTargetCreator will create an index if there is none. But that still gave the error. Help!

INFO  11:13:55,502 HelpFormatter - -------------------------------------------------------------------------------- 
INFO  11:13:55,615 HelpFormatter - The Genome Analysis Toolkit (GATK) v3.7-0-gcfedb67, Compiled 2016/12/12 11:21:18 
INFO  11:13:55,615 HelpFormatter - Copyright (c) 2010-2016 The Broad Institute 
INFO  11:13:55,616 HelpFormatter - For support and documentation go to https://software.broadinstitute.org/gatk 
INFO  11:13:55,616 HelpFormatter - [Wed Jul 26 11:13:55 PDT 2017] Executing on Linux 4.4.0-47-generic amd64 
INFO  11:13:55,616 HelpFormatter - Java HotSpot(TM) 64-Bit Server VM 1.8.0_72-b15 
INFO  11:13:55,621 HelpFormatter - Program Args: --analysis_type RealignerTargetCreator --reference_sequence /share/carvajal-archive/REFERENCE_DATA/genomes/GRCh38_decoy_LCCpanel/Homo_sapiens_assembly38_LCCpanel.fasta --intervals BED/3025671_Covered_hg38_decoyLCCpnl.pad200.bed --input_file DATA/CH-59/N2/CH-59N2.dedup.bam --out DATA/CH-59/N2/CH-59N2.realign.interval_list --validation_strictness STRICT -known /share/carvajal-archive/REFERENCE_DATA/GATK_Bundle/hg38/Mills_and_1000G_gold_standard.indels.hg38.vcf 
INFO  11:13:55,626 HelpFormatter - Executing as [email protected] on Linux 4.4.0-47-generic amd64; Java HotSpot(TM) 64-Bit Server VM 1.8.0_72-b15. 
INFO  11:13:55,626 HelpFormatter - Date/Time: 2017/07/26 11:13:55 
INFO  11:13:55,627 HelpFormatter - -------------------------------------------------------------------------------- 
INFO  11:13:55,627 HelpFormatter - -------------------------------------------------------------------------------- 
INFO  11:13:55,634 GenomeAnalysisEngine - Strictness is STRICT 
INFO  11:13:59,404 GenomeAnalysisEngine - Downsampling Settings: Method: BY_SAMPLE, Target Coverage: 1000 
INFO  11:13:59,411 SAMDataSource$SAMReaders - Initializing SAMRecords in serial 
INFO  11:14:00,008 SAMDataSource$SAMReaders - Done initializing BAM readers: total time 0.60 
##### ERROR --
##### ERROR stack trace 
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at htsjdk.tribble.index.IndexFactory.loadIndex(IndexFactory.java:173)
        at org.broadinstitute.gatk.utils.refdata.tracks.RMDTrackBuilder.loadFromDisk(RMDTrackBuilder.java:375)
        at org.broadinstitute.gatk.utils.refdata.tracks.RMDTrackBuilder.attemptToLockAndLoadIndexFromDisk(RMDTrackBuilder.java:359)
        at org.broadinstitute.gatk.utils.refdata.tracks.RMDTrackBuilder.loadIndex(RMDTrackBuilder.java:319)
        at org.broadinstitute.gatk.utils.refdata.tracks.RMDTrackBuilder.getFeatureSource(RMDTrackBuilder.java:264)
        at org.broadinstitute.gatk.utils.refdata.tracks.RMDTrackBuilder.createInstanceOfTrack(RMDTrackBuilder.java:153)
        at org.broadinstitute.gatk.engine.datasources.rmd.ReferenceOrderedQueryDataPool.<init>(ReferenceOrderedDataSource.java:208)
        at org.broadinstitute.gatk.engine.datasources.rmd.ReferenceOrderedDataSource.<init>(ReferenceOrderedDataSource.java:88)
        at org.broadinstitute.gatk.engine.GenomeAnalysisEngine.getReferenceOrderedDataSources(GenomeAnalysisEngine.java:1052)
        at org.broadinstitute.gatk.engine.GenomeAnalysisEngine.initializeDataSources(GenomeAnalysisEngine.java:829)
        at org.broadinstitute.gatk.engine.GenomeAnalysisEngine.execute(GenomeAnalysisEngine.java:287)
        at org.broadinstitute.gatk.engine.CommandLineExecutable.execute(CommandLineExecutable.java:123)
        at org.broadinstitute.gatk.utils.commandline.CommandLineProgram.start(CommandLineProgram.java:256)
        at org.broadinstitute.gatk.utils.commandline.CommandLineProgram.start(CommandLineProgram.java:158)
        at org.broadinstitute.gatk.engine.CommandLineGATK.main(CommandLineGATK.java:108)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at htsjdk.tribble.index.IndexFactory.loadIndex(IndexFactory.java:169)
        ... 14 more
Caused by: java.io.EOFException
        at htsjdk.tribble.util.LittleEndianInputStream.readFully(LittleEndianInputStream.java:138)
        at htsjdk.tribble.util.LittleEndianInputStream.readLong(LittleEndianInputStream.java:80)
        at htsjdk.tribble.index.linear.LinearIndex$ChrIndex.read(LinearIndex.java:271)
        at htsjdk.tribble.index.AbstractIndex.read(AbstractIndex.java:367)
        at htsjdk.tribble.index.linear.LinearIndex.<init>(LinearIndex.java:101)
        ... 19 more
##### ERROR ------------------------------------------------------------------------------------------
##### ERROR A GATK RUNTIME ERROR has occurred (version 3.7-0-gcfedb67):
##### ERROR
##### ERROR This might be a bug. Please check the documentation guide to see if this is a known problem.
##### ERROR If not, please post the error message, with stack trace, to the GATK forum.
##### ERROR Visit our website and forum for extensive documentation and answers to 
##### ERROR commonly asked questions https://software.broadinstitute.org/gatk
##### ERROR
##### ERROR MESSAGE: java.lang.reflect.InvocationTargetException
##### ERROR ------------------------------------------------------------------------------------------

Best Answers

Answers

  • tedtoaltedtoal Member
    edited July 2017

    Ok, I solved it. The problem was not with the .bam file index, it was with the index for the .vcf file that was the -known argument.

    The GATK RealignerTargetCreator documentation says -known should be a .vcf file, which it was. I had an associated .vcf.idx index file created with bcftools index, in the same directory. I don't know if that contributed to the error or not. But, if I change the -known arg to a .vcf.gz file that has a .vcf.gz.tbi index, the error does not occur.

    I think the documentation should say that a .vcf.gz file is required. Also, I don't think the GATK tool should be throwing this exception. Instead it should have a reasonable error message, such as "Missing index file for xxxx.vcf" or "Index file for xxxx.vcf is not in a valid format"

    Issue · Github
    by Sheila

    Issue Number
    2401
    State
    closed
    Last Updated
    Assignee
    Array
    Milestone
    Array
    Closed By
    chandrans
  • LouisBLouisB Broad InstituteMember, Broadie, Dev ✭✭

    @tedtoal Would it be possible for you to upload your vcf file and index to our ftp so that we can reproduce the error?

Sign In or Register to comment.