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.

/N/soft/rhel7/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] done. Elapsed time: 273.37 minutes.
at java.nio.Buffer.nextGetIndex(
at java.nio.DirectByteBuffer.getInt(
at htsjdk.samtools.AbstractBAMFileIndex$MemoryMappedFileBuffer.readInteger(
at htsjdk.samtools.AbstractBAMFileIndex.readInteger(
at htsjdk.samtools.AbstractBAMFileIndex.query(
at htsjdk.samtools.DiskBasedBAMFileIndex.getSpanOverlapping(
at htsjdk.samtools.BAMFileReader.getFileSpan(
at htsjdk.samtools.BAMFileReader.createIndexIterator(
at htsjdk.samtools.BAMFileReader.query(
at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(
at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.queryOverlapping(
at org.broadinstitute.hellbender.utils.iterators.SamReaderQueryingIterator.loadNextIterator(
at org.broadinstitute.hellbender.utils.iterators.SamReaderQueryingIterator.<init>(
at org.broadinstitute.hellbender.engine.ReadsDataSource.prepareIteratorsForTraversal(
at org.broadinstitute.hellbender.engine.ReadsDataSource.iterator(
at org.broadinstitute.hellbender.engine.MultiIntervalLocalReadShard.iterator(
at org.broadinstitute.hellbender.engine.AssemblyRegionIterator.<init>(
at org.broadinstitute.hellbender.engine.AssemblyRegionWalker.processReadShard(
at org.broadinstitute.hellbender.engine.AssemblyRegionWalker.traverse(
at org.broadinstitute.hellbender.engine.GATKTool.doWork(
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMainPostParseArgs(
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(
at org.broadinstitute.hellbender.Main.runCommandLineProgram(
at org.broadinstitute.hellbender.Main.mainEntry(
at org.broadinstitute.hellbender.Main.main(


  • 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 (

Sign In or Register to comment.