We've moved!
This site is now read-only. You can find our new documentation site and support forum for posting questions here.
Be sure to read our welcome blog!

java.lang.NullPointerException error

Dear GATK team,
I am using GATK v4.0.6.0 to analyze target enrichment data, while calculating on target reads with CountReads, everything seems fine but extra information pasted below appears at last. My command is:
java -Xms10g -jar gatk-package-4.0.6.0-local.jar CountReads -R hg38.fa --interval-padding 100 -I _sorted_rmdups.bam -L capture_targets.bed -LE true >_capture_padded_ontarget_reads.txt

Something surprised me is that if the parameter --interval-padding 100 is not added and only ontarget reads in capture regions are calculated, this extra information will not appear and the it will generate the result file. But I want to calculated ontarget reads in padded capture regions, so could you please help to solve the problem? Thanks!

java.lang.NullPointerException
at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:325)
at java.util.ComparableTimSort.sort(ComparableTimSort.java:202)
at java.util.Arrays.sort(Arrays.java:1312)
at java.util.Arrays.sort(Arrays.java:1506)
at java.util.ArrayList.sort(ArrayList.java:1462)
at java.util.Collections.sort(Collections.java:141)
at org.broadinstitute.hellbender.utils.IntervalUtils.sortAndMergeIntervals(IntervalUtils.java:459)
at org.broadinstitute.hellbender.utils.IntervalUtils.getIntervalsWithFlanks(IntervalUtils.java:956)
at org.broadinstitute.hellbender.utils.IntervalUtils.loadIntervals(IntervalUtils.java:229)
at org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection.parseIntervals(IntervalArgumentCollection.java:174)
at org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection.getTraversalParameters(IntervalArgumentCollection.java:155)
at org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection.getIntervals(IntervalArgumentCollection.java:111)
at org.broadinstitute.hellbender.engine.GATKTool.initializeIntervals(GATKTool.java:445)
at org.broadinstitute.hellbender.engine.GATKTool.onStartup(GATKTool.java:640)
at org.broadinstitute.hellbender.engine.ReadWalker.onStartup(ReadWalker.java:50)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:133)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMainPostParseArgs(CommandLineProgram.java:180)
at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:199)
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)

Answers

  • bhanuGandhambhanuGandham Cambridge MAMember, Administrator, Broadie, Moderator admin

    Hi @xiang_zuo

    Can you please post the entire error log.

  • xiang_zuoxiang_zuo shanghaiMember

    @bhanuGandham said:
    Hi @xiang_zuo

    Can you please post the entire error log.

    08:03:59.420 INFO NativeLibraryLoader - Loading libgkl_compression.so from jar:file:gatk-package-4.0.6.0-local.jar!/com/intel/gkl/native/libgkl_compression.so
    08:03:59.567 INFO CountReads - ------------------------------------------------------------
    08:03:59.567 INFO CountReads - The Genome Analysis Toolkit (GATK) v4.0.6.0
    08:03:59.567 INFO CountReads - For support and documentation go to https://software.broadinstitute.org/gatk/
    08:03:59.567 INFO CountReads - Executing as [email protected] on Linux v3.10.0-514.el7.x86_64 amd64
    08:03:59.567 INFO CountReads - Java runtime: Java HotSpot(TM) 64-Bit Server VM v1.8.0_152-b16
    08:03:59.568 INFO CountReads - Start Date/Time: September 6, 2019 8:03:59 AM CST
    08:03:59.568 INFO CountReads - ------------------------------------------------------------
    08:03:59.568 INFO CountReads - ------------------------------------------------------------
    08:03:59.568 INFO CountReads - HTSJDK Version: 2.16.0
    08:03:59.568 INFO CountReads - Picard Version: 2.18.7
    08:03:59.568 INFO CountReads - HTSJDK Defaults.COMPRESSION_LEVEL : 2
    08:03:59.568 INFO CountReads - HTSJDK Defaults.USE_ASYNC_IO_READ_FOR_SAMTOOLS : false
    08:03:59.569 INFO CountReads - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_SAMTOOLS : true
    08:03:59.569 INFO CountReads - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_TRIBBLE : false
    08:03:59.569 INFO CountReads - Deflater: IntelDeflater
    08:03:59.569 INFO CountReads - Inflater: IntelInflater
    08:03:59.569 INFO CountReads - GCS max retries/reopens: 20
    08:03:59.569 INFO CountReads - Using google-cloud-java patch 6d11bef1c81f885c26b2b56c8616b7a705171e4f from https://github.com/droazen/google-cloud-java/tree/dr_all_nio_fixes
    08:03:59.569 INFO CountReads - Initializing engine
    08:04:00.108 INFO FeatureManager - Using codec BEDCodec to read file file:///capture_targets.bed
    08:04:00.138 INFO CountReads - Shutting down engine
    [September 6, 2019 8:04:00 AM CST] org.broadinstitute.hellbender.tools.CountReads done. Elapsed time: 0.01 minutes.
    Runtime.totalMemory()=11060903936
    java.lang.NullPointerException
    at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:325)
    at java.util.ComparableTimSort.sort(ComparableTimSort.java:202)
    at java.util.Arrays.sort(Arrays.java:1312)
    at java.util.Arrays.sort(Arrays.java:1506)
    at java.util.ArrayList.sort(ArrayList.java:1462)
    at java.util.Collections.sort(Collections.java:141)
    at org.broadinstitute.hellbender.utils.IntervalUtils.sortAndMergeIntervals(IntervalUtils.java:459)
    at org.broadinstitute.hellbender.utils.IntervalUtils.getIntervalsWithFlanks(IntervalUtils.java:956)
    at org.broadinstitute.hellbender.utils.IntervalUtils.loadIntervals(IntervalUtils.java:229)
    at org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection.parseIntervals(IntervalArgumentCollection.java:174)
    at org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection.getTraversalParameters(IntervalArgumentCollection.java:155)
    at org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection.getIntervals(IntervalArgumentCollection.java:111)
    at org.broadinstitute.hellbender.engine.GATKTool.initializeIntervals(GATKTool.java:445)
    at org.broadinstitute.hellbender.engine.GATKTool.onStartup(GATKTool.java:640)
    at org.broadinstitute.hellbender.engine.ReadWalker.onStartup(ReadWalker.java:50)
    at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:133)
    at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMainPostParseArgs(CommandLineProgram.java:180)
    at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:199)
    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)

  • bhanuGandhambhanuGandham Cambridge MAMember, Administrator, Broadie, Moderator admin

    HI @xiang_zuo

    Can you please try this with the latest GATKv4.1.3.0 and see if the problem persists.

  • bhanuGandhambhanuGandham Cambridge MAMember, Administrator, Broadie, Moderator admin
    edited September 2019

    @xiang_zuo

    Can you please provide read length of the input. If possible can you please provide the output of samtool stats of the input bam file.

  • xiang_zuoxiang_zuo shanghaiMember

    @bhanuGandham said:
    @xiang_zuo

    Can you please provide read length of the input. If possible can you please provide the output of samtool stats of the input bam file.

    @bhanuGandham
    The read length is PE150. The output of samtools stats is very long, how can I show you the result? Or which key information do you need?

  • bhanuGandhambhanuGandham Cambridge MAMember, Administrator, Broadie, Moderator admin

    Hi @xiang_zuo

    Sorry that is my bad. I meant samtools flagstat Sample_sorted.bam. Thank you!

  • bhanuGandhambhanuGandham Cambridge MAMember, Administrator, Broadie, Moderator admin

    Also please test with the latest GATK4.1 version and let me know if the issue persists.

  • xiang_zuoxiang_zuo shanghaiMember

    @bhanuGandham said:
    Hi @xiang_zuo

    Sorry that is my bad. I meant samtools flagstat Sample_sorted.bam. Thank you!

    4794470 + 0 in total (QC-passed reads + QC-failed reads)
    10816 + 0 secondary
    0 + 0 supplementary
    0 + 0 duplicates
    4794214 + 0 mapped (99.99% : N/A)
    4783654 + 0 paired in sequencing
    2391829 + 0 read1
    2391825 + 0 read2
    4766748 + 0 properly paired (99.65% : N/A)
    4783396 + 0 with itself and mate mapped
    2 + 0 singletons (0.00% : N/A)
    14510 + 0 with mate mapped to a different chr
    12703 + 0 with mate mapped to a different chr (mapQ>=5)

  • xiang_zuoxiang_zuo shanghaiMember

    @bhanuGandham said:
    Also please test with the latest GATK4.1 version and let me know if the issue persists.

    Ok, I am downloading the newest version, and I will tell you the results then. Thanks!

  • xiang_zuoxiang_zuo shanghaiMember

    @bhanuGandham said:
    Also please test with the latest GATK4.1 version and let me know if the issue persists.

    @bhanuGandham

    The command is:
    java -Xms10g -jar gatk-package-4.1.3.0-local.jar CountReads -R hg38.fa --interval-padding 100 -I _sorted_rmdups.bam -L capture_targets.bed -LE true >_capture_padded_ontarget_reads.txt

    But the error information still appears, which I pasted below.

    Runtime.totalMemory()=10290200576
    java.lang.NullPointerException
    at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:325)
    at java.util.ComparableTimSort.sort(ComparableTimSort.java:202)
    at java.util.Arrays.sort(Arrays.java:1312)
    at java.util.Arrays.sort(Arrays.java:1506)
    at java.util.ArrayList.sort(ArrayList.java:1462)
    at java.util.Collections.sort(Collections.java:141)
    at org.broadinstitute.hellbender.utils.IntervalUtils.sortAndMergeIntervals(IntervalUtils.java:459)
    at org.broadinstitute.hellbender.utils.IntervalUtils.getIntervalsWithFlanks(IntervalUtils.java:957)
    at org.broadinstitute.hellbender.utils.IntervalUtils.loadIntervals(IntervalUtils.java:229)
    at org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection.parseIntervals(IntervalArgumentCollection.java:174)
    at org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection.getTraversalParameters(IntervalArgumentCollection.java:155)
    at org.broadinstitute.hellbender.cmdline.argumentcollections.IntervalArgumentCollection.getIntervals(IntervalArgumentCollection.java:111)
    at org.broadinstitute.hellbender.engine.GATKTool.initializeIntervals(GATKTool.java:513)
    at org.broadinstitute.hellbender.engine.GATKTool.onStartup(GATKTool.java:708)
    at org.broadinstitute.hellbender.engine.ReadWalker.onStartup(ReadWalker.java:50)
    at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(CommandLineProgram.java:137)
    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)

  • bhanuGandhambhanuGandham Cambridge MAMember, Administrator, Broadie, Moderator admin

    @xiang_zuo Hmmm that is weird. And just to be clear, you are saying that when you run this exact same command but just without the 'interval-padding 100' it works just fine?

  • xiang_zuoxiang_zuo shanghaiMember

    @bhanuGandham said:
    @xiang_zuo Hmmm that is weird. And just to be clear, you are saying that when you run this exact same command but just without the 'interval-padding 100' it works just fine?

    Yes, I am sure it works. And I also analyzed a whole exome sequencing data successfully with the same command.

  • bhanuGandhambhanuGandham Cambridge MAMember, Administrator, Broadie, Moderator admin

    Hi @xiang_zuo

    Can you confirm that the bed file used is compatible with the reference(hg38) sequence dictionary?

  • xiang_zuoxiang_zuo shanghaiMember

    @bhanuGandham said:
    Hi @xiang_zuo

    Can you confirm that the bed file used is compatible with the reference(hg38) sequence dictionary?

    Thanks. Sorry that I made a mistake, my colleague told me that the panel was designed based on hg19, so I change the ref genome to hg19 and then everything goes well. Thanks for your help.

Sign In or Register to comment.