VariantAnnotator returns NullPointerException
If you are seeing an error, please provide(REQUIRED) :
a) GATK version used:
4.1.8.1
b) Exact command used:
gatk VariantAnnotator -V WES.vcf.gz -I WES.bam --output WES_VA.vcf -A Coverage
c) Entire error log:
java.lang.NullPointerException
at org.broadinstitute.hellbender.tools.walkers.haplotypecaller.AssemblyBasedCallerUtils.splitReadsBySample(AssemblyBasedCallerUtils.java:162)
at org.broadinstitute.hellbender.tools.walkers.annotator.VariantAnnotator.makeLikelihoods(VariantAnnotator.java:244)
at org.broadinstitute.hellbender.tools.walkers.annotator.VariantAnnotator.apply(VariantAnnotator.java:234)
at org.broadinstitute.hellbender.engine.VariantWalker.lambda$traverse$0(VariantWalker.java:104)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at org.broadinstitute.hellbender.engine.VariantWalker.traverse(VariantWalker.java:102)
at org.broadinstitute.hellbender.engine.GATKTool.doWork(GATKTool.java:1049)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:140)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMainPostParseArgs(CommandLineProgram.java:192)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:211)
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)
-
Hello, for posts regarding GATK issues, we require three items to be included in the post.
-
GATK version number
-
Complete Stack Trace/Error log
-
Exact command used
Your post is missing one of these items. Please include all three so that we can thoroughly look into the problem.
-
-
Hi Genevieve, I see the problem, I indeed omitted the INFO fields. Sorry, let me retry from scratch:
GATK version used:
4.1.9.0 (also in 4.1.8.1)
Exact command used:
gatk VariantAnnotator -V s220_AETO_cr_filtered.vcf.gz -I Exomeseq_s85_CR_q20_srt_mdup_RG_BSQR.bam --output s3817_VA.vcf -A DepthPerAlleleBySample
Complete stack trace
Using GATK jar /hpc/pmc_stunnenberg/wout/software/gatk-4.1.9.0/gatk-package-4.1.9.0-local.jar
Running:
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 -jar /hpc/pmc_stunnenberg/wout/software/gatk-4.1.9.0/gatk-package-4.1.9.0-local.jar VariantAnnotator -V s220_AETO_cr_filtered.vcf.gz -I Exomeseq_s85_CR_q20_srt_mdup_RG_BSQR.bam --output s3817_VA.vcf -A DepthPerAlleleBySample
12:10:34.658 INFO NativeLibraryLoader - Loading libgkl_compression.so from jar:file:/hpc/pmc_stunnenberg/wout/software/gatk-4.1.9.0/gatk-package-4.1.9.0-local.jar!/com/intel/gkl/native/libgkl_compression.so
Oct 22, 2020 12:10:36 PM shaded.cloud_nio.com.google.auth.oauth2.ComputeEngineCredentials runningOnComputeEngine
INFO: Failed to detect whether we are running on Google Compute Engine.
12:10:36.219 INFO VariantAnnotator - ------------------------------------------------------------
12:10:36.220 INFO VariantAnnotator - The Genome Analysis Toolkit (GATK) v4.1.9.0
12:10:36.220 INFO VariantAnnotator - For support and documentation go to https://software.broadinstitute.org/gatk/
12:10:36.221 INFO VariantAnnotator - Executing as wmegchelenbrink@hpcs04.op.umcutrecht.nl on Linux v3.10.0-1062.4.3.el7.x86_64 amd64
12:10:36.221 INFO VariantAnnotator - Java runtime: OpenJDK 64-Bit Server VM v11.0.8-internal+0-adhoc..src
12:10:36.221 INFO VariantAnnotator - Start Date/Time: October 22, 2020 at 12:10:34 PM CEST
12:10:36.221 INFO VariantAnnotator - ------------------------------------------------------------
12:10:36.221 INFO VariantAnnotator - ------------------------------------------------------------
12:10:36.222 INFO VariantAnnotator - HTSJDK Version: 2.23.0
12:10:36.222 INFO VariantAnnotator - Picard Version: 2.23.3
12:10:36.222 INFO VariantAnnotator - HTSJDK Defaults.COMPRESSION_LEVEL : 2
12:10:36.222 INFO VariantAnnotator - HTSJDK Defaults.USE_ASYNC_IO_READ_FOR_SAMTOOLS : false
12:10:36.223 INFO VariantAnnotator - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_SAMTOOLS : true
12:10:36.223 INFO VariantAnnotator - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_TRIBBLE : false
12:10:36.223 INFO VariantAnnotator - Deflater: IntelDeflater
12:10:36.223 INFO VariantAnnotator - Inflater: IntelInflater
12:10:36.223 INFO VariantAnnotator - GCS max retries/reopens: 20
12:10:36.223 INFO VariantAnnotator - Requester pays: disabled
12:10:36.223 INFO VariantAnnotator - Initializing engine
12:10:36.551 INFO FeatureManager - Using codec VCFCodec to read file file:///hpc/pmc_stunnenberg/wout/projects/yanan_celseq2/WES/bam/s220_AETO_cr_filtered.vcf.gz
12:10:37.089 INFO VariantAnnotator - Done initializing engine
12:10:37.188 INFO ProgressMeter - Starting traversal
12:10:37.188 INFO ProgressMeter - Current Locus Elapsed Minutes Variants Processed Variants/Minute
12:10:37.498 INFO VariantAnnotator - Shutting down engine
[October 22, 2020 at 12:10:37 PM CEST] org.broadinstitute.hellbender.tools.walkers.annotator.VariantAnnotator done. Elapsed time: 0.05 minutes.
Runtime.totalMemory()=1621884928
java.lang.NullPointerException
at org.broadinstitute.hellbender.tools.walkers.haplotypecaller.AssemblyBasedCallerUtils.splitReadsBySample(AssemblyBasedCallerUtils.java:162)
at org.broadinstitute.hellbender.tools.walkers.annotator.VariantAnnotator.makeLikelihoods(VariantAnnotator.java:244)
at org.broadinstitute.hellbender.tools.walkers.annotator.VariantAnnotator.apply(VariantAnnotator.java:234)
at org.broadinstitute.hellbender.engine.VariantWalker.lambda$traverse$0(VariantWalker.java:104)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at org.broadinstitute.hellbender.engine.VariantWalker.traverse(VariantWalker.java:102)
at org.broadinstitute.hellbender.engine.GATKTool.doWork(GATKTool.java:1049)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:140)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMainPostParseArgs(CommandLineProgram.java:192)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:211)
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)Best regards,
Wout
-
Hi Wout Megchelenbrink, thanks so much for providing that.
Does your BAM header contain the proper read group & sample information? Here is more info about what GATK requires in a BAM file: https://gatk.broadinstitute.org/hc/en-us/articles/360035890791-SAM-or-BAM-or-CRAM-Mapped-sequence-data-formats
-
Hi Genevieve,
The BAM files were fine, I ran the "somatic variant calling best practice" , including the AddOrReplaceReadGroups function with them. As i feared, most of the problem was caused by an entity between my chair and the screen ;-)
In brief, I was testing the VariantAnnotation tool on a VCF for which the sample names were not in the BAM file. What probably happens is that the tool searches reads that correspond to each of the samples in the VCF file. In this case, the BAM file and the VCF had no samples in common. This probably led to the NULL pointer exception in the SplitSamples function, which likely received no samples at all.
Adding a simple validation with a more meaningful error description would probably be helpful to others in the future. For me the problem is solved.
Best,
WoutPS: I do have a question about the VariantAnnotator, but it is not releated to this error, so I will add a new post for that.
-
Hi Wout Megchelenbrink, glad that you found the issue, and thank you for posting your solution so that it is useful for other GATK users!
I have created an issue request on the GATK github page to improve the error message, you can track the progress here.
-
Wout Megchelenbrink just wanted to update you that the GATK Team has fixed this issue with the error message and the change will be in the next update of GATK.
Post is closed for comments.
6 comments