Genome Analysis Toolkit

Variant Discovery in High-Throughput Sequencing Data

GATK process banner

Need Help?

Search our documentation

Community Forum

Hi, How can we help?

Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools with a primary focus on variant discovery and genotyping. Its powerful processing engine and high-performance computing features make it capable of taking on projects of any size. Learn more

Mutect2 java.lang.NullPointerException



  • Avatar
    Genevieve Brandt (she/her)

    Saskia is this the entire error log? Please send it so we can look into the issue.

    Comment actions Permalink
  • Avatar

    Well, I can't tell what the error log is,  Mutect2 starts and I see progress and then shuts down. But there is no stats file afterwards and I can't find out what the java.lang.NullPointerException means...




    Using GATK jar GATK/
    java -Dsamjdk.use_async_io_read_samtools=false -Dsamjdk.use_async_io_write_samtools=true -Dsamjdk.use_async_io_write_tribble=false -Dsamjdk.compression_level=2 -Xmx16g -jar /GATK/ Mutect2 -R ref/Homo_sapiens_assembly38.fasta -I SRR_MM10_2pass_recal.bam --germline-resource /af-only-gnomad.hg38.vcf.gz --panel-of-normals ref/1000g_pon.hg38.vcf.gz -O SRR_somatic_mutect.vcf.gz
    13:24:08.400 INFO NativeLibraryLoader - Loading from jar:file:/GATK/!/com/intel/gkl/native/
    Sep 25, 2020 1:24:08 PM runningOnComputeEngine
    INFO: Failed to detect whether we are running on Google Compute Engine.
    13:24:08.556 INFO Mutect2 - ------------------------------------------------------------
    13:24:08.557 INFO Mutect2 - The Genome Analysis Toolkit (GATK) v4.1.8.1
    13:24:08.557 INFO Mutect2 - For support and documentation go to
    13:24:08.557 INFO Mutect2 - Executing as xxx on Linux v3.10.0-1127.18.2.el7.x86_64 amd64
    13:24:08.557 INFO Mutect2 - Java runtime: Java HotSpot(TM) 64-Bit Server VM v1.8.0_192-b12
    13:24:08.557 INFO Mutect2 - Start Date/Time: September 25, 2020 1:24:08 PM BST
    13:24:08.557 INFO Mutect2 - ------------------------------------------------------------
    13:24:08.557 INFO Mutect2 - ------------------------------------------------------------
    13:24:08.557 INFO Mutect2 - HTSJDK Version: 2.23.0
    13:24:08.557 INFO Mutect2 - Picard Version: 2.22.8
    13:24:08.558 INFO Mutect2 - HTSJDK Defaults.COMPRESSION_LEVEL : 2
    13:24:08.558 INFO Mutect2 - HTSJDK Defaults.USE_ASYNC_IO_READ_FOR_SAMTOOLS : false
    13:24:08.558 INFO Mutect2 - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_SAMTOOLS : true
    13:24:08.558 INFO Mutect2 - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_TRIBBLE : false
    13:24:08.558 INFO Mutect2 - Deflater: IntelDeflater
    13:24:08.558 INFO Mutect2 - Inflater: IntelInflater
    13:24:08.558 INFO Mutect2 - GCS max retries/reopens: 20
    13:24:08.558 INFO Mutect2 - Requester pays: disabled
    13:24:08.558 INFO Mutect2 - Initializing engine
    13:24:09.048 INFO FeatureManager - Using codec VCFCodec to read file file://ref/1000g_pon.hg38.vcf.gz
    13:24:09.207 INFO FeatureManager - Using codec VCFCodec to read file file://ref/af-only-gnomad.hg38.vcf.gz
    13:24:09.374 INFO Mutect2 - Done initializing engine
    13:24:09.435 INFO NativeLibraryLoader - Loading from jar:file:/GATK/!/com/intel/gkl/native/
    13:24:09.438 INFO NativeLibraryLoader - Loading from jar:file:/GATK/!/com/intel/gkl/native/
    13:24:09.472 INFO IntelPairHmm - Using CPU-supported AVX-512 instructions
    13:24:09.472 INFO IntelPairHmm - Flush-to-zero (FTZ) is enabled when running PairHMM
    13:24:09.473 INFO IntelPairHmm - Available threads: 24
    13:24:09.473 INFO IntelPairHmm - Requested threads: 4
    13:24:09.473 INFO PairHMM - Using the OpenMP multi-threaded AVX-accelerated native PairHMM implementation
    13:24:09.501 INFO ProgressMeter - Starting traversal
    13:24:09.502 INFO ProgressMeter - Current Locus Elapsed Minutes Regions Processed Regions/Minute
    13:24:19.721 INFO ProgressMeter - chr1:634040 0.2 2460 14443.7
    13:24:29.736 INFO ProgressMeter - chr1:1564703 0.3 7220 21409.5
    15:28:55.286 INFO ProgressMeter - chrM:12891 124.8 11474080 91967.0
    15:29:08.985 INFO VectorLoglessPairHMM - Time spent in setup for JNI call : 10.162159898
    15:29:08.986 INFO PairHMM - Total compute time in PairHMM computeLogLikelihoods() : 1047.646162184
    15:29:08.986 INFO SmithWatermanAligner - Total compute time in java Smith-Waterman : 1077.35 sec
    15:29:08.986 INFO Mutect2 - Shutting down engine
    [September 25, 2020 3:29:08 PM BST] done. Elapsed time: 125.01 minutes.
    at org.broadinstitute.hellbender.transformers.PalindromeArtifactClipReadTransformer.apply(
    at org.broadinstitute.hellbender.transformers.PalindromeArtifactClipReadTransformer.apply(
    at org.broadinstitute.hellbender.transformers.ReadTransformer.lambda$andThen$f85d1091$1(
    at org.broadinstitute.hellbender.utils.iterators.PushToPullIterator.fillCache(
    at org.broadinstitute.hellbender.utils.iterators.PushToPullIterator.advanceToNextElement(
    at org.broadinstitute.hellbender.utils.iterators.PushToPullIterator.<init>(
    at org.broadinstitute.hellbender.utils.downsampling.ReadsDownsamplingIterator.<init>(
    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(

    Comment actions Permalink
  • Avatar
    Genevieve Brandt (she/her)

    Hello Saskia, yes that looks like the complete stack trace, thank you. 

    This error looks like it was thrown because your BAM has contigs that are not present in the reference you are using. Double check that you are using the exact same reference that you used when you aligned this bam file.

    I created a github ticket so that the error message can be improved, you can view it here

    Comment actions Permalink
  • Avatar

    Thanks Genevieve, that was it!

    Comment actions Permalink
  • Avatar
    Genevieve Brandt (she/her)

    Great, thanks for the update, Saskia.

    Comment actions Permalink
  • Avatar
    Genevieve Brandt (she/her)

    Hi Saskia,

    We are wrapping up the fix for this issue with the error message but we have not been able to replicate the error message you were getting.

    Would you be able to upload test data that created this error message to our bug report ftp site? It would be very helpful!

    Thank you,


    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk