Notice:
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. 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.

Null pointer exception using GATK2 at chr19 for mouse genome

Hi,

I'm doing tumor normal somatic variant calling using ** MuTect2 (gatk v4.1.2.0)**. I have used mm10 reference genome for mapping and I have tried following the general best practices of GATK and Mutect2.

But for some reason the variant calling breaks at chr19 and reports a null pointer exception. This happens to all my samples.

The command I have used for running MuTect2 is as below:

gatk Mutect2 \
    -R $ref \
    -I $BAMs/3_MOO111A3_S8_001.markdup.realigned.bam \
    -I $BAMs/4_MOO111A4_S11_001.markdup.realigned.bam \
    -tumor 3_MOO111A3_S8_001 \
    -normal 4_MOO111A4_S11_001 \
    -O $out/3_4_unfiltered.vcf.gz \
    -bamout $out/3_4_tumor_normal.bam 

The error I get is as follows:

02:04:08.372 INFO  ProgressMeter -       chr19:61211311            984.9               4994610           5071.4
02:04:19.192 INFO  ProgressMeter -       chr19:61266818            985.0               4994840           5070.7
02:04:27.335 INFO  VectorLoglessPairHMM - Time spent in setup for JNI call : 39.543984247000004
02:04:27.335 INFO  PairHMM - Total compute time in PairHMM computeLogLikelihoods() : 15107.717470987001
02:04:27.336 INFO  SmithWatermanAligner - Total compute time in java Smith-Waterman : 14077.45 sec
INFO    2019-07-11 02:04:28 SortingCollection   Creating merging iterator from 34 files
02:05:08.531 INFO  Mutect2 - Shutting down engine
[July 11, 2019 2:05:08 AM EDT] org.broadinstitute.hellbender.tools.walkers.mutect.Mutect2 done. Elapsed time: 985.91 minutes.
Runtime.totalMemory()=2113929216
java.lang.NullPointerException
    at org.broadinstitute.hellbender.transformers.PalindromeArtifactClipReadTransformer.apply(PalindromeArtifactClipReadTransformer.java:98)
    at org.broadinstitute.hellbender.transformers.PalindromeArtifactClipReadTransformer.apply(PalindromeArtifactClipReadTransformer.java:49)
    at org.broadinstitute.hellbender.transformers.ReadTransformer.lambda$andThen$f85d1091$1(ReadTransformer.java:20)
    at org.broadinstitute.hellbender.utils.iterators.ReadTransformingIterator.next(ReadTransformingIterator.java:42)
    at org.broadinstitute.hellbender.utils.iterators.ReadTransformingIterator.next(ReadTransformingIterator.java:14)
    at org.broadinstitute.hellbender.utils.iterators.PushToPullIterator.fillCache(PushToPullIterator.java:72)
    at org.broadinstitute.hellbender.utils.iterators.PushToPullIterator.advanceToNextElement(PushToPullIterator.java:58)
    at org.broadinstitute.hellbender.utils.iterators.PushToPullIterator.<init>(PushToPullIterator.java:37)
    at org.broadinstitute.hellbender.utils.downsampling.ReadsDownsamplingIterator.<init>(ReadsDownsamplingIterator.java:21)
    at org.broadinstitute.hellbender.engine.MultiIntervalLocalReadShard.iterator(MultiIntervalLocalReadShard.java:149)
    at org.broadinstitute.hellbender.engine.AssemblyRegionIterator.<init>(AssemblyRegionIterator.java:109)
    at org.broadinstitute.hellbender.engine.AssemblyRegionWalker.processReadShard(AssemblyRegionWalker.java:296)
    at org.broadinstitute.hellbender.engine.AssemblyRegionWalker.traverse(AssemblyRegionWalker.java:281)
    at org.broadinstitute.hellbender.engine.GATKTool.doWork(GATKTool.java:1039)
    at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:139)
    at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMainPostParseArgs(CommandLineProgram.java:191)
    at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:210)
    at org.broadinstitute.hellbender.Main.runCommandLineProgram(Main.java:162)
    at org.broadinstitute.hellbender.Main.mainEntry(Main.java:205)
    at org.broadinstitute.hellbender.Main.main(Main.java:291)

I have tried reading other posts with Null pointers exception, but could not find a solution for my issue.

I also validate my bam using ValidateSam from picard as per one of the answers. There were no issues/errors with my bam files.

Answers

  • bhanuGandhambhanuGandham Cambridge MAMember, Administrator, Broadie, Moderator admin

    Hi @anish

    As of v4.1, there is no longer a need to specify the tumor sample name with -tumor. You need only specify the normal sample name with -normal, if you include a normal.
    Can you try and again and see if that resolves the issue?

  • anishanish Member

    Hi, I tried using your suggestion. It still failed with the exact same error at chr19.

    Here is the code:

    gatk Mutect2 \
        -R $ref \
        -I $BAMs/3_MOO111A3_S8_001.markdup.realigned.bam \
        -I $BAMs/4_MOO111A4_S11_001.markdup.realigned.bam \
        -normal 4_MOO111A4_S11_001 \
        -O $out/3_4_unfiltered.vcf.gz \
        -bamout $out/3_4_tumor_normal.bam
    
  • bhanuGandhambhanuGandham Cambridge MAMember, Administrator, Broadie, Moderator admin

    Hi @anish

    It looks like there maybe reads in their bam which are aligned to contigs which are not included in the reference used in the call Mutect2. Can you please confirm you are using the same reference? Can you please check the contigs which mapped reads align to the bam, and confirm that all the contigs are in the reference dictionary. The set of contigs for mapped reads in the bam records can be extracted with samtools view -F0x4 ${BAM} | cut -f3 | sort | uniq.

Sign In or Register to comment.