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.

GATK4 Error: java.nio.BufferUnderflowException

cmcpbucmcpbu Waco, TexasMember
Hey there,

I'm using gatk4 on 189 rna-seq samples. Aligned them to our new genome using STAR, read groups/sort with picard, ddup with picard, merged all bams into 1 large bam with all samples. Ran Gatk4. I keep getting this buffer underflow error and I cannot find out how to fix it.

Command:
/N/soft/rhel7/gatk/4.0.4.0/gatk HaplotypeCaller -I 2019.all.bam -R tb_supernova.fasta -O ./vcf/2019.all.snps.vcf -

This is the error I received.


15:13:27.995 INFO VectorLoglessPairHMM - Time spent in setup for JNI call : 0.0
15:13:27.995 INFO PairHMM - Total compute time in PairHMM computeLogLikelihoods() : 0.0
15:13:27.996 INFO SmithWatermanAligner - Total compute time in java Smith-Waterman : 0.00 sec
15:13:27.996 INFO HaplotypeCaller - Shutting down engine
[June 30, 2019 3:13:27 PM EDT] org.broadinstitute.hellbender.tools.walkers.haplotypecaller.HaplotypeCaller done. Elapsed time: 273.37 minutes.
Runtime.totalMemory()=2076049408
java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:506)
at java.nio.DirectByteBuffer.getInt(DirectByteBuffer.java:681)
at htsjdk.samtools.AbstractBAMFileIndex$MemoryMappedFileBuffer.readInteger(AbstractBAMFileIndex.java:498)
at htsjdk.samtools.AbstractBAMFileIndex.readInteger(AbstractBAMFileIndex.java:442)
at htsjdk.samtools.AbstractBAMFileIndex.query(AbstractBAMFileIndex.java:279)
at htsjdk.samtools.DiskBasedBAMFileIndex.getSpanOverlapping(DiskBasedBAMFileIndex.java:61)
at htsjdk.samtools.BAMFileReader.getFileSpan(BAMFileReader.java:898)
at htsjdk.samtools.BAMFileReader.createIndexIterator(BAMFileReader.java:915)
at htsjdk.samtools.BAMFileReader.query(BAMFileReader.java:575)
at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:528)
at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.queryOverlapping(SamReader.java:400)
at org.broadinstitute.hellbender.utils.iterators.SamReaderQueryingIterator.loadNextIterator(SamReaderQueryingIterator.java:125)
at org.broadinstitute.hellbender.utils.iterators.SamReaderQueryingIterator.<init>(SamReaderQueryingIterator.java:66)
at org.broadinstitute.hellbender.engine.ReadsDataSource.prepareIteratorsForTraversal(ReadsDataSource.java:404)
at org.broadinstitute.hellbender.engine.ReadsDataSource.iterator(ReadsDataSource.java:330)
at org.broadinstitute.hellbender.engine.MultiIntervalLocalReadShard.iterator(MultiIntervalLocalReadShard.java:134)
at org.broadinstitute.hellbender.engine.AssemblyRegionIterator.<init>(AssemblyRegionIterator.java:109)
at org.broadinstitute.hellbender.engine.AssemblyRegionWalker.processReadShard(AssemblyRegionWalker.java:286)
at org.broadinstitute.hellbender.engine.AssemblyRegionWalker.traverse(AssemblyRegionWalker.java:271)
at org.broadinstitute.hellbender.engine.GATKTool.doWork(GATKTool.java:892)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:134)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMainPostParseArgs(CommandLineProgram.java:179)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:198)
at org.broadinstitute.hellbender.Main.runCommandLineProgram(Main.java:160)
at org.broadinstitute.hellbender.Main.mainEntry(Main.java:203)
at org.broadinstitute.hellbender.Main.main(Main.java:289)

Answers

  • bhanuGandhambhanuGandham Cambridge MAMember, Administrator, Broadie, Moderator admin

    Hi @cmcpbu

    This could be a BAM indexing issue, and here are some suggestions to resolve that:
    1) can you please regenerate your bam index and try rerunning?
    2) If that doesn't work can you please try it on the latest GATK (4.1.2.0)?

Sign In or Register to comment.