Tagged with #null pointer exception
0 documentation articles | 0 announcements | 3 forum discussions


No posts found with the requested search criteria.
No posts found with the requested search criteria.
Comments (0)

Hi there,

I've a problem running GATK2.8's VariantRecalibrator, I get Code Exception (java.lang.NullPointerException). Below is the error trace:

INFO 17:05:37,528 GenomeAnalysisEngine - Preparing for traversal INFO 17:14:27,706 VariantDataManager - MQRankSum: mean = -0.09 standard deviation = 0.99 INFO 17:14:27,742 VariantDataManager - ReadPosRankSum: mean = 0.18 standard deviation = 0.96 INFO 17:14:27,820 VariantDataManager - Annotations are now ordered by their information content: [QD, ReadPosRankSum, MQRankSum] INFO 17:14:27,823 VariantDataManager - Training with 2739 variants after standard deviation thresholding. INFO 17:14:27,829 GaussianMixtureModel - Initializing model with 100 k-means iterations... INFO 17:14:28,389 VariantRecalibratorEngine - Finished iteration 0. INFO 17:14:28,534 VariantRecalibratorEngine - Finished iteration 5. Current change in mixture coefficients = 0.20522 INFO 17:14:28,601 VariantRecalibratorEngine - Finished iteration 10. Current change in mixture coefficients = 0.46290 INFO 17:14:28,675 VariantRecalibratorEngine - Finished iteration 15. Current change in mixture coefficients = 9.95604 INFO 17:14:28,759 VariantRecalibratorEngine - Finished iteration 20. Current change in mixture coefficients = 9.00456 INFO 17:14:28,861 VariantRecalibratorEngine - Finished iteration 25. Current change in mixture coefficients = 0.01190 INFO 17:14:28,951 VariantRecalibratorEngine - Finished iteration 30. Current change in mixture coefficients = 0.00796 INFO 17:14:29,041 VariantRecalibratorEngine - Finished iteration 35. Current change in mixture coefficients = 0.00546 INFO 17:14:29,131 VariantRecalibratorEngine - Finished iteration 40. Current change in mixture coefficients = 0.00360 INFO 17:14:29,221 VariantRecalibratorEngine - Finished iteration 45. Current change in mixture coefficients = 0.00218 INFO 17:14:29,239 VariantRecalibratorEngine - Convergence after 46 iterations! INFO 17:14:29,276 VariantRecalibratorEngine - Evaluating full set of 13495 variants... INFO 17:14:29,280 VariantDataManager - Training with worst 0 scoring variants --> variants with LOD <= -5.0000. INFO 17:14:32,024 GATKRunReport - Uploaded run statistics report to AWS S3

ERROR ------------------------------------------------------------------------------------------
ERROR stack trace

java.lang.NullPointerException at org.broadinstitute.sting.gatk.walkers.variantrecalibration.VariantRecalibratorEngine.generateModel(VariantRecalibratorEngine.java:83) at org.broadinstitute.sting.gatk.walkers.variantrecalibration.VariantRecalibrator.onTraversalDone(VariantRecalibrator.java:359) at org.broadinstitute.sting.gatk.walkers.variantrecalibration.VariantRecalibrator.onTraversalDone(VariantRecalibrator.java:139) at org.broadinstitute.sting.gatk.executive.Accumulator$StandardAccumulator.finishTraversal(Accumulator.java:129) at org.broadinstitute.sting.gatk.executive.LinearMicroScheduler.execute(LinearMicroScheduler.java:116) at org.broadinstitute.sting.gatk.GenomeAnalysisEngine.execute(GenomeAnalysisEngine.java:313) at org.broadinstitute.sting.gatk.CommandLineExecutable.execute(CommandLineExecutable.java:113) at org.broadinstitute.sting.commandline.CommandLineProgram.start(CommandLineProgram.java:245) at org.broadinstitute.sting.commandline.CommandLineProgram.start(CommandLineProgram.java:152) at org.broadinstitute.sting.gatk.CommandLineGATK.main(CommandLineGATK.java:91)

ERROR ------------------------------------------------------------------------------------------
ERROR A GATK RUNTIME ERROR has occurred (version 2.8-1-g932cd3a):
ERROR
ERROR This might be a bug. Please check the documentation guide to see if this is a known problem.
ERROR If not, please post the error message, with stack trace, to the GATK forum.
ERROR Visit our website and forum for extensive documentation and answers to
ERROR commonly asked questions http://www.broadinstitute.org/gatk
ERROR
ERROR MESSAGE: Code exception (see stack trace for error itself)
ERROR ------------------------------------------------------------------------------------------

And this is the command i used:

java -XX:+UseParallelGC -XX:ParallelGCThreads=8 -Xmx4g -jar ~/genomekey-data/tools/gatk2.jar -T VariantRecalibrator -R ~/genomekey-data/bwa_references/human_g1k_v37.fasta -input ~/simplex/ngs_test/snp_calling/aln.haplotyper.raw.vcf -resource:dbsnp,known=true,training=false,truth=false,prior=8.0 ~/genomekey-data/bundle/current/dbsnp_137.b37.vcf -resource:hapmap,VCF,known=false,training=true,truth=true,prior=15.0 ~/genomekey-data/bundle/current/hapmap_3.3.b37.vcf -resource:omni,VCF,known=false,training=true,truth=false,prior=12.0 ~/genomekey-data/bundle/current/1000G_omni2.5.b37.vcf -an QD -an MQRankSum -an ReadPosRankSum -recalFile ~/simplex/ngs_test/snp_recal/aln.snp.recal -tranche 100 -tranche 99.9 -tranche 99.0 -tranche 90 -tranchesFile ~/simplex/ngs_test/snp_recal/aln.snp.tranches -rscriptFile ~/simplex/ngs_test/snp_recal/aln.snp.plots.R -mode SNP

Please note that i got the same error running GATK 2.6. Any help or suggestions will be appreciated.

Thanks, Shazly

Comments (2)

I'm building a variant calling qscript (it's available here), heavily based on the the MethodsDevelopmentCallingPipeline.scala. I cannot however run into trouble when setting the "this.scatterCount" of the GenotyperBase to more than 1 - in which case I get a NullPointerException (I include the full error message below).

I use the following command line:

java -Djava.io.tmpdir=tmp -jar dist/Queue.jar -S public/scala/qscript/org/broadinstitute/sting/queue/qscripts/NewVariantCalling.scala -i NA12878.HiSeq.WGS.bwa.cleaned.recal.hg19.20.bam -R /bubo/nobackup/uppnex/reference/biodata/GATK/ftp.broadinstitute.org/bundle/2.2/b37/human_g1k_v37.fasta -res /bubo/nobackup/uppnex/reference/biodata/GATK/ftp.broadinstitute.org/bundle/2.2/b37/ **-sg 2** -nt 8 -run -l DEBUG -startFromScratch

As you can see, I'm using the files from the gatk bundle, and I guess these should be alright for this purpose? Just to be clear I use the "-res" parameter to point to the directory where all the resource files are located, dbsnp, hapmap, etc. and the -sg parameter is what controls the scatter/gather count.

I've tried to search in the code for what might be causing this, and I can conclude that the org.broadinstitute.sting.utils.GenomeLocParser.parseGenomeLoc is called with str (its parameter) being an empty string, which is what causes contig to be null, which in turn creates the NullPointerException on line 408 when this line is executed: stop = getContigInfo(contig).getSequenceLength();

This, I guess, is the obvious stuff, but this far I haven't been able to figure this out any further that this. I'm not sure if this is caused by a bug in my script, or by a bug in the GATK. Right now I'm thinking the latter of the two, since I have used the scatter/gather function in other scripts without any trouble.

Any ideas of where to continue from here, or confirmation that this is indeed something related to the GATK code would be much appreciated.

Cheers, Johan

ERROR 16:22:50,781 FunctionEdge - Error: LocusScatterFunction: List(/bubo/proj/a2009002/SnpSeqPipeline/SnpSeqPipeline/gatk/NA12878.HiSeq.WGS.bwa.cleaned.recal.hg19.20.bam.bai, /bubo/nobackup/uppnex/reference/biodata/GATK/ftp.broadinstitute.org/bundle/2.2/b37/dbsnp_137.b37.vcf, /bubo/nobackup/uppnex/reference/biodata/GATK/ftp.broadinstitute.org/bundle/2.2/b37/human_g1k_v37.fasta, /bubo/proj/a2009002/SnpSeqPipeline/SnpSeqPipeline/gatk/NA12878.HiSeq.WGS.bwa.cleaned.recal.hg19.20.bai, /bubo/nobackup/uppnex/reference/biodata/GATK/ftp.broadinstitute.org/bundle/2.2/b37/dbsnp_137.b37.vcf.idx, /bubo/proj/a2009002/SnpSeqPipeline/SnpSeqPipeline/gatk/NA12878.HiSeq.WGS.bwa.cleaned.recal.hg19.20.bam) > List(/bubo/proj/a2009002/SnpSeqPipeline/SnpSeqPipeline/gatk/.queue/scatterGather/.qlog/project.snpcall-sg/temp_1_of_2/scatter.intervals, /bubo/proj/a2009002/SnpSeqPipeline/SnpSeqPipeline/gatk/.queue/scatterGather/.qlog/project.snpcall-sg/temp_2_of_2/scatter.intervals) 
java.lang.NullPointerException
        at org.broadinstitute.sting.utils.GenomeLocParser.parseGenomeLoc(GenomeLocParser.java:408)
        at org.broadinstitute.sting.utils.interval.IntervalUtils.parseIntervalArguments(IntervalUtils.java:84)
        at org.broadinstitute.sting.commandline.IntervalBinding.getIntervals(IntervalBinding.java:97)
        at org.broadinstitute.sting.utils.interval.IntervalUtils.loadIntervals(IntervalUtils.java:538)
        at org.broadinstitute.sting.utils.interval.IntervalUtils.parseIntervalBindingsPair(IntervalUtils.java:520)
        at org.broadinstitute.sting.utils.interval.IntervalUtils.parseIntervalBindings(IntervalUtils.java:499)
        at org.broadinstitute.sting.queue.extensions.gatk.GATKIntervals.locs(GATKIntervals.scala:60)
        at org.broadinstitute.sting.queue.extensions.gatk.LocusScatterFunction.run(LocusScatterFunction.scala:39)
        at org.broadinstitute.sting.queue.engine.InProcessRunner.start(InProcessRunner.scala:28)
        at org.broadinstitute.sting.queue.engine.FunctionEdge.start(FunctionEdge.scala:83)
        at org.broadinstitute.sting.queue.engine.QGraph.runJobs(QGraph.scala:432)
        at org.broadinstitute.sting.queue.engine.QGraph.run(QGraph.scala:154)
        at org.broadinstitute.sting.queue.QCommandLine.execute(QCommandLine.scala:145)
        at org.broadinstitute.sting.commandline.CommandLineProgram.start(CommandLineProgram.java:236)
        at org.broadinstitute.sting.commandline.CommandLineProgram.start(CommandLineProgram.java:146)
        at org.broadinstitute.sting.queue.QCommandLine$.main(QCommandLine.scala:62)
        at org.broadinstitute.sting.queue.QCommandLine.main(QCommandLine.scala)
Comments (14)

Hi all,

Has anyone else gotten the following:

java.lang.NullPointerException at org.broadinstitute.sting.gatk.walkers.phasing.PhaseByTransmission.phaseTrioGenotypes(PhaseByTransmission.java:242) at org.broadinstitute.sting.gatk.walkers.phasing.PhaseByTransmission.map(PhaseByTransmission.java:306) at org.broadinstitute.sting.gatk.walkers.phasing.PhaseByTransmission.map(PhaseByTransmission.java:35) at org.broadinstitute.sting.gatk.traversals.TraverseLoci.traverse(TraverseLoci.java:78) at org.broadinstitute.sting.gatk.traversals.TraverseLoci.traverse(TraverseLoci.java:18) at org.broadinstitute.sting.gatk.executive.LinearMicroScheduler.execute(LinearMicroScheduler.java:62) at org.broadinstitute.sting.gatk.GenomeAnalysisEngine.execute(GenomeAnalysisEngine.java:225) at org.broadinstitute.sting.gatk.CommandLineExecutable.execute(CommandLineExecutable.java:122) at org.broadinstitute.sting.commandline.CommandLineProgram.start(CommandLineProgram.java:236) at org.broadinstitute.sting.commandline.CommandLineProgram.start(CommandLineProgram.java:149) at org.broadinstitute.sting.gatk.CommandLineGATK.main(CommandLineGATK.java:91)

My command line was: java -jar GenomeAnalysisTK.jar -T PhaseByTransmission -V w01.sorted.vcf -o w01.phased.vcf -f "mom+dad=child" -R hg19.fa

Cheers,

Paul