Tagged with #nullpointerexception
0 documentation articles | 0 announcements | 4 forum discussions


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

Hello,

I was asked to re-post this question here. It was originally posted in the Picard forum at GitHub at https://github.com/broadinstitute/picard/issues/161.

Regards,

Bernt


ORIGINAL POST (edited)

There seems to be a problems with FixMateInformation crashing with

Exception in thread "main" java.lang.``````NullPointerException``````
at htsjdk.samtools.SamPairUtil.setMateInformationOnSupplementalAlignment(SamPairUtil.java:300)
at htsjdk.samtools.SamPairUtil$SetMateInfoIterator.advance(SamPairUtil.java:442)
at htsjdk.samtools.SamPairUtil$SetMateInfoIterator.next(SamPairUtil.java:454)
at htsjdk.samtools.SamPairUtil$SetMateInfoIterator.next(SamPairUtil.java:360)
at picard.sam.FixMateInformation.doWork(FixMateInformation.java:194)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:185)
at picard.cmdline.CommandLineProgram.instanceMainWithExit(CommandLineProgram.java:125)
at picard.sam.FixMateInformation.main(FixMateInformation.java:93)

The problem first appeared in version 1.121. It is present in version 1.128. Versions prior to 1.120 worked and continue to work fine. I am currently using Java 1.7.0_75, but I observed the same problem with earlier version of Java. The problem occurs under several different version of Fedora.

The command lines I am using are:

java -jar picard-1.128/picard.jar FixMateInformation INPUT=test.bam OUTPUT=fixed.bam (fails)

java -jar picard-1.121/FixMateInformation.jar INPUT=test.bam OUTPUT=fixed.bam (fails)

java -jar picard-1.120/FixMateInformation.jar INPUT=test.bam OUTPUT=fixed.bam (succeeds)

I have observed the problem with various BAM files. This one is (a small subset of) the output of an indel realignment with GATK.


Later in the same thread:

ValidateSam produces: java -jar /opt/ghpc/picard-1.121/ValidateSamFile.jar INPUT=test.bam OUTPUT=out.bam [Wed Feb 18 08:48:40 CET 2015] picard.sam.ValidateSamFile INPUT=test.bam OUTPUT=out.bam MODE=VERBOSE MAX_OUTPUT=100 IGNORE_WARNINGS=false VALIDATE_INDEX=true IS_BISULFITE_SEQUENCED=false MAX_OPEN_TEMP_FILES=8000 VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false [Wed Feb 18 08:48:40 CET 2015] Executing as bernt@interactive.ghpc.dk on Linux 2.6.35.14-106.fc14.x86_64 amd64; Java HotSpot(TM) 64-Bit Server VM 1.7.0_75-b13; Picard version: 1.121(da291b4d265f877808b216dce96eaeffd2f30bd3_1411396652) IntelDeflater [Wed Feb 18 08:48:41 CET 2015] picard.sam.ValidateSamFile done. Elapsed time: 0.01 minutes. Runtime.totalMemory()=505937920 To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp


And later:

The problem also exists in the new version, 1.129.


New

Re-posted in GATK forum

Picard (1.129)'s ValidateSamFile complains about Mate not found - which was the reason for running FixMateInformation in the first place.

The output is:

java -jar /opt/ghpc/picard-current/picard.jar ValidateSamFile I=test.bam

[Thu Mar 26 16:44:49 CET 2015] picard.sam.ValidateSamFile INPUT=test.bam    MODE=VERBOSE MAX_OUTPUT=100 IGNORE_WARNINGS=false VALIDATE_INDEX=true IS_BISULFITE_SEQUENCED=false MAX_OPEN_TEMP_FILES=8000 VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false
[Thu Mar 26 16:44:49 CET 2015] Executing as bernt@interactive.ghpc.dk on Linux 2.6.35.14-106.fc14.x86_64 amd64; Java HotSpot(TM) 64-Bit Server VM 1.7.0_75-b13; Picard version: 1.129(b508b2885562a4e932d3a3a60b8ea283b7ec78e2_1424706677) IntelDeflater
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2215:5439:78978, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1216:7853:25411, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2301:9078:52020, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2104:18417:29553, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2310:18752:24451, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2310:6551:24766, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1105:9672:78339, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2112:20003:44801, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2213:8473:74864, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2306:11852:94726, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1110:11106:17369, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2215:12401:47072, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2312:13964:14859, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1312:3886:41184, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1206:12827:34659, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1107:18908:98983, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1313:7640:45146, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1306:1595:15034, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2209:2036:47281, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1201:6826:100382, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2213:4861:63517, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2204:10202:63100, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1207:7125:93640, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1101:9691:36089, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2211:1839:100174, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2312:7331:16518, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2303:13396:44533, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1103:15274:86897, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2110:1541:39614, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1206:10320:20874, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2104:12084:25830, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2115:6231:35664, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1106:5365:6728, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1201:5887:87680, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1204:9449:99890, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2207:6920:91927, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1113:17505:78862, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2311:19423:17546, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2303:6787:39570, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1116:6350:25293, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1305:15016:58323, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1116:10894:97830, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2306:13179:38191, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1301:11303:99731, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2102:13726:37821, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2312:11652:76919, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1208:4895:32748, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1106:9371:79983, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2111:1798:22917, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1107:1267:20231, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1109:15189:92031, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2302:9045:63944, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1102:14247:57062, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2305:7407:36655, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2204:12584:72228, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1111:18302:40904, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2316:8382:94789, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2109:12845:82338, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1206:10557:31568, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2210:14790:11210, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1303:7824:5423, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2111:9909:100689, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2202:16293:94205, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1102:16519:74708, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1305:10365:69588, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2102:8288:100810, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1311:17645:65928, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1109:17819:68329, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2206:3160:52730, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1112:18820:52584, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1108:4475:4687, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2205:7334:35631, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2106:9384:64665, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2316:12960:78271, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1104:3451:71528, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2211:21055:28695, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2202:13814:96357, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2111:17147:10853, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2106:20520:88043, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1214:2637:77724, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1109:9367:35640, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1215:11379:23758, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1304:17507:91188, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2204:12459:100042, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2216:8585:77239, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1313:12667:24591, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1316:10367:5281, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1315:15333:2359, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1206:5534:7650, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2102:4820:93659, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2104:6528:72676, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2305:7297:76200, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1315:5361:88165, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2305:17200:26640, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1302:2356:100479, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1101:3217:24975, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2314:1898:42432, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:1316:5424:4897, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2104:16620:81246, Mate not found for paired read
ERROR: Read name HWI-D00474:91:C62ARANXX:8:2102:15822:17446, Mate not found for paired read
Maximum output of [100] errors reached.
[Thu Mar 26 16:44:50 CET 2015] picard.sam.ValidateSamFile done. Elapsed time: 0.01 minutes.
Runtime.totalMemory()=505937920
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp

Please let me know where to send the test BAM file.

Regards,

Bernt

Comments (17)

Hi,

I encountered a NullPointerException in 3.2-2 using the HaplotypeCaller on a BAM that run just fine on 3.1. Here is the stack trace:

java.lang.NullPointerException at org.broadinstitute.gatk.tools.walkers.haplotypecaller.PairHMMLikelihoodCalculationEngine.computeDiploidHaplotypeLikelihoods(PairHMMLikelihoodCalculationEngine.java:421) at org.broadinstitute.gatk.tools.walkers.haplotypecaller.PairHMMLikelihoodCalculationEngine.computeDiploidHaplotypeLikelihoods(PairHMMLikelihoodCalculationEngine.java:395) at org.broadinstitute.gatk.tools.walkers.haplotypecaller.HaplotypeCallerGenotypingEngine.calculateGLsForThisEvent(HaplotypeCallerGenotypingEngine.java:421) at org.broadinstitute.gatk.tools.walkers.haplotypecaller.HaplotypeCallerGenotypingEngine.assignGenotypeLikelihoods(HaplotypeCallerGenotypingEngine.java:257) at org.broadinstitute.gatk.tools.walkers.haplotypecaller.HaplotypeCaller.map(HaplotypeCaller.java:941) at org.broadinstitute.gatk.tools.walkers.haplotypecaller.HaplotypeCaller.map(HaplotypeCaller.java:218) at org.broadinstitute.gatk.engine.traversals.TraverseActiveRegions$TraverseActiveRegionMap.apply(TraverseActiveRegions.java:708) at org.broadinstitute.gatk.engine.traversals.TraverseActiveRegions$TraverseActiveRegionMap.apply(TraverseActiveRegions.java:704) at org.broadinstitute.gatk.utils.nanoScheduler.NanoScheduler$ReadMapReduceJob.run(NanoScheduler.java:471) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722)

And here are the program args:

Program Args: -T HaplotypeCaller -R human_genome/human_g1k_v37.fasta -I <my_bam> -ERC GVCF -nct 16 --dbsnp /tmp/4437712/dbsnp_135.b37.vcf --variant_index_type LINEAR --variant_index_parameter 128000 -o /tmp/4437712/<my_sample>.vcf.gz

Let me know if you need more info.

Comments (3)

I am following the GATK best practices workflow on Linux. I am using chr21.fa as reference from NCBI and .vcf files are taken from resource bundle and dbsnp.vcf is from NCBI. I am working on the VariantRecalibrator step. It gives me NullPointerException. I am attaching the console error that I have got which contains the command also and raw_variants.vcf which is generated in previous step by HaplotypeCaller tool in txt format. Please let me know what can be the issue.

Comments (22)

java.lang.NullPointerException at org.broadinstitute.sting.gatk.walkers.haplotypecaller.LikelihoodCalculationEngine.computeDiploidHaplotypeLikelihoods(LikelihoodCalculationEngine.java:379) at org.broadinstitute.sting.gatk.walkers.haplotypecaller.LikelihoodCalculationEngine.computeDiploidHaplotypeLikelihoods(LikelihoodCalculationEngine.java:353) at org.broadinstitute.sting.gatk.walkers.haplotypecaller.GenotypingEngine.calculateGLsForThisEvent(GenotypingEngine.java:338) at org.broadinstitute.sting.gatk.walkers.haplotypecaller.GenotypingEngine.assignGenotypeLikelihoods(GenotypingEngine.java:205) at org.broadinstitute.sting.gatk.walkers.haplotypecaller.HaplotypeCaller.map(HaplotypeCaller.java:778) at org.broadinstitute.sting.gatk.walkers.haplotypecaller.HaplotypeCaller.map(HaplotypeCaller.java:140) at org.broadinstitute.sting.gatk.traversals.TraverseActiveRegions$TraverseActiveRegionMap.apply(TraverseActiveRegions.java:708) at org.broadinstitute.sting.gatk.traversals.TraverseActiveRegions$TraverseActiveRegionMap.apply(TraverseActiveRegions.java:704) at org.broadinstitute.sting.utils.nanoScheduler.NanoScheduler$ReadMapReduceJob.run(NanoScheduler.java:471) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724)

Program Args: -nct 5 -T HaplotypeCaller -R ../ref/ref.fa -L chr10 -I <48 bam files> -o chr10.raw.vcf