From 57cf7047041fa141928a3ecdf9368a6b21779522 Mon Sep 17 00:00:00 2001 From: MartonKN Date: Wed, 28 Nov 2018 15:30:45 -0500 Subject: [PATCH 1/5] Fixed issue #4943: the debug variable of AsseemblyResultSet wasn't set anywhere, and therefore the command line argument debug didn't propagate to the function buildEventMapsForHaplotypes in EventMap.java. I added the function setDebug to AssemblyResultSet, and set its value in HaplotypeCallerEngine. --- .../hellbender/engine/filters/CountingVariantFilter.java | 2 +- .../tools/walkers/haplotypecaller/AssemblyResultSet.java | 5 +++++ .../tools/walkers/haplotypecaller/HaplotypeCallerEngine.java | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/broadinstitute/hellbender/engine/filters/CountingVariantFilter.java b/src/main/java/org/broadinstitute/hellbender/engine/filters/CountingVariantFilter.java index ce1a507871b..f9d15210ef2 100644 --- a/src/main/java/org/broadinstitute/hellbender/engine/filters/CountingVariantFilter.java +++ b/src/main/java/org/broadinstitute/hellbender/engine/filters/CountingVariantFilter.java @@ -17,7 +17,7 @@ * (ie., not all variant filters in a compound predicate will necessarily be evaluated every time). Also note * that the count for a compound predicate does not always equal the sum of the counts of it's component * predicates, i.e. an "or" filter will report a filter count of 1 in the case where both component predicates - * are evaluated and both fail, but the the individual component filters will report a count of 1 at the next + * are evaluated and both fail, but the individual component filters will report a count of 1 at the next * level. */ public class CountingVariantFilter implements VariantFilter { diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyResultSet.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyResultSet.java index 4e0e2eeed46..f1ec2d42929 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyResultSet.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyResultSet.java @@ -518,4 +518,9 @@ public SortedSet getVariationEvents(final int maxMnpDistance) { } return variationEvents; } + + // Set the debug variable + public void setDebug(boolean debug) { + this.debug = debug; + } } diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCallerEngine.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCallerEngine.java index ee248b90c5e..8848907c41b 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCallerEngine.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCallerEngine.java @@ -536,7 +536,7 @@ public List callRegion(final AssemblyRegion region, final Featur // run the local assembler, getting back a collection of information on how we should proceed final AssemblyResultSet untrimmedAssemblyResult = AssemblyBasedCallerUtils.assembleReads(region, givenAlleles, hcArgs, readsHeader, samplesList, logger, referenceReader, assemblyEngine, aligner); - + untrimmedAssemblyResult.setDebug(hcArgs.debug); final SortedSet allVariationEvents = untrimmedAssemblyResult.getVariationEvents(hcArgs.maxMnpDistance); // TODO - line bellow might be unnecessary : it might be that assemblyResult will always have those alleles anyway // TODO - so check and remove if that is the case: From 55826eb89d822a0350f43cb33eedd2518bc6ef5c Mon Sep 17 00:00:00 2001 From: MartonKN Date: Thu, 29 Nov 2018 11:36:18 -0500 Subject: [PATCH 2/5] Did the same changes to Mutect2Engine. --- .../tools/walkers/haplotypecaller/AssemblyResultSet.java | 1 - .../hellbender/tools/walkers/mutect/Mutect2Engine.java | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyResultSet.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyResultSet.java index f1ec2d42929..b05934e3620 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyResultSet.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyResultSet.java @@ -519,7 +519,6 @@ public SortedSet getVariationEvents(final int maxMnpDistance) { return variationEvents; } - // Set the debug variable public void setDebug(boolean debug) { this.debug = debug; } diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java index c552344b722..0bbf005e297 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java @@ -193,6 +193,7 @@ public List callRegion(final AssemblyRegion originalAssemblyRegi final AssemblyRegion assemblyActiveRegion = AssemblyBasedCallerUtils.assemblyRegionWithWellMappedReads(originalAssemblyRegion, READ_QUALITY_FILTER_THRESHOLD, header); final AssemblyResultSet untrimmedAssemblyResult = AssemblyBasedCallerUtils.assembleReads(assemblyActiveRegion, givenAlleles, MTAC, header, samplesList, logger, referenceReader, assemblyEngine, aligner); + untrimmedAssemblyResult.setDebug(MTAC.debug); final SortedSet allVariationEvents = untrimmedAssemblyResult.getVariationEvents(MTAC.maxMnpDistance); final AssemblyRegionTrimmer.Result trimmingResult = trimmer.trim(originalAssemblyRegion, allVariationEvents); if (!trimmingResult.isVariationPresent()) { From d8e7c950dc65e3064e9b967900f0f78635fd1cc6 Mon Sep 17 00:00:00 2001 From: MartonKN Date: Fri, 30 Nov 2018 12:13:43 -0500 Subject: [PATCH 3/5] Changed where the debug variable is set for AssemblyResultSet. Previously, I set those after initialization in Mutect2Engine and HaplotypeCallerEngine, and now I do it at initialization. --- .../tools/walkers/haplotypecaller/AssemblyBasedCallerUtils.java | 1 + .../tools/walkers/haplotypecaller/HaplotypeCallerEngine.java | 2 +- .../hellbender/tools/walkers/mutect/Mutect2Engine.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyBasedCallerUtils.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyBasedCallerUtils.java index c0ac67c177b..ac353d1878c 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyBasedCallerUtils.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyBasedCallerUtils.java @@ -266,6 +266,7 @@ public static AssemblyResultSet assembleReads(final AssemblyRegion region, final AssemblyResultSet assemblyResultSet = assemblyEngine.runLocalAssembly(region, referenceHaplotype, fullReferenceWithPadding, paddedReferenceLoc, givenAlleles, readErrorCorrector, header, aligner); + assemblyResultSet.setDebug(argumentCollection.debug); assemblyResultSet.debugDump(logger); return assemblyResultSet; } catch (final Exception e){ diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCallerEngine.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCallerEngine.java index 8848907c41b..5b114e03daf 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCallerEngine.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCallerEngine.java @@ -536,7 +536,7 @@ public List callRegion(final AssemblyRegion region, final Featur // run the local assembler, getting back a collection of information on how we should proceed final AssemblyResultSet untrimmedAssemblyResult = AssemblyBasedCallerUtils.assembleReads(region, givenAlleles, hcArgs, readsHeader, samplesList, logger, referenceReader, assemblyEngine, aligner); - untrimmedAssemblyResult.setDebug(hcArgs.debug); + final SortedSet allVariationEvents = untrimmedAssemblyResult.getVariationEvents(hcArgs.maxMnpDistance); // TODO - line bellow might be unnecessary : it might be that assemblyResult will always have those alleles anyway // TODO - so check and remove if that is the case: diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java index 0bbf005e297..f4ef2bed9f2 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java @@ -193,7 +193,7 @@ public List callRegion(final AssemblyRegion originalAssemblyRegi final AssemblyRegion assemblyActiveRegion = AssemblyBasedCallerUtils.assemblyRegionWithWellMappedReads(originalAssemblyRegion, READ_QUALITY_FILTER_THRESHOLD, header); final AssemblyResultSet untrimmedAssemblyResult = AssemblyBasedCallerUtils.assembleReads(assemblyActiveRegion, givenAlleles, MTAC, header, samplesList, logger, referenceReader, assemblyEngine, aligner); - untrimmedAssemblyResult.setDebug(MTAC.debug); + // untrimmedAssemblyResult.setDebug(MTAC.debug); final SortedSet allVariationEvents = untrimmedAssemblyResult.getVariationEvents(MTAC.maxMnpDistance); final AssemblyRegionTrimmer.Result trimmingResult = trimmer.trim(originalAssemblyRegion, allVariationEvents); if (!trimmingResult.isVariationPresent()) { From b99212b3aea76fc4ff597d15fca5181eb87eeff2 Mon Sep 17 00:00:00 2001 From: MartonKN Date: Fri, 30 Nov 2018 12:14:11 -0500 Subject: [PATCH 4/5] Removed unnecessary comment. --- .../hellbender/tools/walkers/mutect/Mutect2Engine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java index f4ef2bed9f2..487ffff69c6 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java @@ -193,7 +193,7 @@ public List callRegion(final AssemblyRegion originalAssemblyRegi final AssemblyRegion assemblyActiveRegion = AssemblyBasedCallerUtils.assemblyRegionWithWellMappedReads(originalAssemblyRegion, READ_QUALITY_FILTER_THRESHOLD, header); final AssemblyResultSet untrimmedAssemblyResult = AssemblyBasedCallerUtils.assembleReads(assemblyActiveRegion, givenAlleles, MTAC, header, samplesList, logger, referenceReader, assemblyEngine, aligner); - // untrimmedAssemblyResult.setDebug(MTAC.debug); + final SortedSet allVariationEvents = untrimmedAssemblyResult.getVariationEvents(MTAC.maxMnpDistance); final AssemblyRegionTrimmer.Result trimmingResult = trimmer.trim(originalAssemblyRegion, allVariationEvents); if (!trimmingResult.isVariationPresent()) { From 2cf61d4f1ebf19d3ec966722f11d67bfb9b55ca9 Mon Sep 17 00:00:00 2001 From: MartonKN Date: Fri, 30 Nov 2018 12:21:05 -0500 Subject: [PATCH 5/5] Minor change --- .../hellbender/tools/walkers/mutect/Mutect2Engine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java index 487ffff69c6..209e381fc1b 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/Mutect2Engine.java @@ -193,7 +193,7 @@ public List callRegion(final AssemblyRegion originalAssemblyRegi final AssemblyRegion assemblyActiveRegion = AssemblyBasedCallerUtils.assemblyRegionWithWellMappedReads(originalAssemblyRegion, READ_QUALITY_FILTER_THRESHOLD, header); final AssemblyResultSet untrimmedAssemblyResult = AssemblyBasedCallerUtils.assembleReads(assemblyActiveRegion, givenAlleles, MTAC, header, samplesList, logger, referenceReader, assemblyEngine, aligner); - + final SortedSet allVariationEvents = untrimmedAssemblyResult.getVariationEvents(MTAC.maxMnpDistance); final AssemblyRegionTrimmer.Result trimmingResult = trimmer.trim(originalAssemblyRegion, allVariationEvents); if (!trimmingResult.isVariationPresent()) {