Mutect2 - Need one or two reads to construct a fragment
The command I used below is able to generate the .vcf output along with its index and stats file, but my snakemake run fails to complete due to exit status (3 instead of 0). I wonder if below error is caused by trying to split the runs by chromosome and setting improper interval padding.
Thank you for your time.
------------------------------------------------------------------------------------------------------------------------------------
a) GATK version used
The Genome Analysis Toolkit (GATK) v4.1.4.1
b) Exact GATK commands used
/usr/bin/time -v gatk --java-options "-Xmx10G" Mutect2 -R ../reference/indices_010920/GRCh38.d1.vd1.fa -L chr4.bed -I chr4.bam --max-mnp-distance 0 --interval-padding 100 -O chr4.vcf.gz
c) The entire error log if applicable.
java.lang.IllegalArgumentException: Need one or two reads to construct a fragment
at org.broadinstitute.hellbender.utils.Utils.validateArg(Utils.java:725)
at org.broadinstitute.hellbender.utils.read.Fragment.create(Fragment.java:43)
at org.broadinstitute.hellbender.utils.read.Fragment.createAndAvoidFailure(Fragment.java:58)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1376)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.broadinstitute.hellbender.utils.genotyper.AlleleLikelihoods.groupEvidence(AlleleLikelihoods.java:589)
at org.broadinstitute.hellbender.tools.walkers.mutect.SomaticGenotypingEngine.callMutations(SomaticGenotypingEngine.java:93)
at org.broadinstitute.hellbender.tools.walkers.mutect.Mutect2Engine.callRegion(Mutect2Engine.java:251)
at org.broadinstitute.hellbender.tools.walkers.mutect.Mutect2.apply(Mutect2.java:320)
at org.broadinstitute.hellbender.engine.AssemblyRegionWalker.processReadShard(AssemblyRegionWalker.java:308)
at org.broadinstitute.hellbender.engine.AssemblyRegionWalker.traverse(AssemblyRegionWalker.java:281)
at org.broadinstitute.hellbender.engine.GATKTool.doWork(GATKTool.java:1048)
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:163)
at org.broadinstitute.hellbender.Main.mainEntry(Main.java:206)
at org.broadinstitute.hellbender.Main.main(Main.java:292)
-
Hi DB
For clarification, you are able to run the command posted above manually but when this command is used in a Snakemake workflow script the above error is seen? -
That is correct. I wonder if the error message should be of concern although an output was generated.
-
If that's the case then this might not be a GATK related issue, it could be associated with the Snakemake script where the GATK command is not given the correct arguments. We're more familiar with WDL workflows than Snakemake but some common suggestions would be to use full paths to the desired input files and double check the command Snakemake is actually using when running GATK (this should be written in a log file).
-
I don't think that's true. Examining the log from the GATK run for the problematic chromosome, the arguments are correctly provided since I can observe the lines indicating that the file has been processed. I assume if the arguments were not provided correctly, then the log file would immediately show the error without GATK processing any of the reads.
For the purpose of this post, I would like some assistance in better understanding the error message "Need one or two reads to construct a fragment" more so than the issue with Snakemake.
-
Got it, I'll create a ticket for the dev team to investigate.
-
Thank you! Will I be notified on this post or will I have to follow up in another manner?
-
You'll be notified on this post
-
The dev team mentioned this error might be associated with the following Git Pull Request: https://github.com/broadinstitute/gatk/pull/6327 . This has been merged to the GATK master branch but has yet to be released. You can try building GATK locally from the master branch and test it.
-
Thanks Beri. I thought I might add the full error message as a reference for the dev team or whoever might find useful. The command I run generates a .VCF file, but if you look at it, MuTect2 seems to stop around half point of chromosome 2 and finishes:
15:42:02.606 INFO ProgressMeter - chr2:108490446 4.7 204560 43411.9
15:42:12.500 INFO VectorLoglessPairHMM - Time spent in setup for JNI call : 0.263049886
15:42:12.500 INFO PairHMM - Total compute time in PairHMM computeLogLikelihoods() : 31.062298165
15:42:12.500 INFO SmithWatermanAligner - Total compute time in java Smith-Waterman : 24.30 sec
15:42:12.501 INFO Mutect2 - Shutting down engine
[January 27, 2020 3:42:12 PM EST] org.broadinstitute.hellbender.tools.walkers.mutect.Mutect2 done. Elapsed time: 4.91 minutes.
Runtime.totalMemory()=2076049408
java.lang.IllegalArgumentException: Need one or two reads to construct a fragment
at org.broadinstitute.hellbender.utils.Utils.validateArg(Utils.java:725)
at org.broadinstitute.hellbender.utils.read.Fragment.create(Fragment.java:43)
at org.broadinstitute.hellbender.utils.read.Fragment.createAndAvoidFailure(Fragment.java:58)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1376)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.broadinstitute.hellbender.utils.genotyper.AlleleLikelihoods.groupEvidence(AlleleLikelihoods.java:589)
at org.broadinstitute.hellbender.tools.walkers.mutect.SomaticGenotypingEngine.callMutations(SomaticGenotypingEngine.java:93)
at org.broadinstitute.hellbender.tools.walkers.mutect.Mutect2Engine.callRegion(Mutect2Engine.java:251)
at org.broadinstitute.hellbender.tools.walkers.mutect.Mutect2.apply(Mutect2.java:320)
at org.broadinstitute.hellbender.engine.AssemblyRegionWalker.processReadShard(AssemblyRegionWalker.java:308)
at org.broadinstitute.hellbender.engine.AssemblyRegionWalker.traverse(AssemblyRegionWalker.java:281)
at org.broadinstitute.hellbender.engine.GATKTool.doWork(GATKTool.java:1048)
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:163)
at org.broadinstitute.hellbender.Main.mainEntry(Main.java:206)
at org.broadinstitute.hellbender.Main.main(Main.java:292) -
Hi Beri,
Just wanted to confirm that pulling from Github repo seemed to have resolved the issue.
Is it correct to interpret the error message as: during the run, the current release version of MuTect2 gives an exception because there is insufficient number of (primary+supplemental) reads for a specific loci where variant calling is being performed?
-
The comment from the pull request states "Modified the fragment creation code to not throw an exception in the case that there are more than 2 reads supporting a fragment and they are all supplementary, secondary, and/or duplicates. Instead, it will just pick one of those reads to use." It sounds like it produces an exception when there is more than 2 reads at a specific loci, I can double check with the team if you would like.
-
Hi!
Do you think setting --independent-mates as True could help solving this issue? -
Jenifer Doing so harms accuracy. It is preferable to use the latest GATK release.
Please sign in to leave a comment.
13 comments