From 31fc64f82cc5fc87cc4764f4ce05c0f53ea00a76 Mon Sep 17 00:00:00 2001 From: Laura Gauthier Date: Mon, 14 Mar 2016 13:17:29 -0400 Subject: [PATCH 1/2] To address weird case with all hom-refs, but alt allele is present, skip AS_QD for all-ref sites and remove raw annotations whether or not they can be successfully finalized --- .../gatk/tools/walkers/annotator/AS_QualByDepth.java | 2 ++ .../gatk/tools/walkers/annotator/VariantAnnotatorEngine.java | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/AS_QualByDepth.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/AS_QualByDepth.java index e4c806e6a..8df281d72 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/AS_QualByDepth.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/AS_QualByDepth.java @@ -172,6 +172,8 @@ public class AS_QualByDepth extends InfoFieldAnnotation implements ReducibleAnno return null; final List standardDepth = getAlleleDepths(genotypes); + if (standardDepth == null) //all no-calls and homRefs + return null; //Parse the VC's allele-specific qual values List alleleQualObjList = vc.getAttributeAsList(GATKVCFConstants.AS_QUAL_KEY); diff --git a/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/VariantAnnotatorEngine.java b/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/VariantAnnotatorEngine.java index d62029fb3..e8394cec4 100644 --- a/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/VariantAnnotatorEngine.java +++ b/public/gatk-tools-public/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/VariantAnnotatorEngine.java @@ -357,9 +357,9 @@ public class VariantAnnotatorEngine { final Map annotationsFromCurrentType = currentASannotation.finalizeRawData(vc, originalVC); if ( annotationsFromCurrentType != null ) { infoAnnotations.putAll(annotationsFromCurrentType); - //clean up raw annotation data after annotations are finalized - infoAnnotations.remove(currentASannotation.getRawKeyName()); } + //clean up raw annotation data after annotations are finalized + infoAnnotations.remove(currentASannotation.getRawKeyName()); } // generate a new annotated VC From 9ffdfeccd53e37428d5cbc711f53f561ed59cc95 Mon Sep 17 00:00:00 2001 From: Laura Gauthier Date: Tue, 15 Mar 2016 11:06:48 -0400 Subject: [PATCH 2/2] Add test case for fix --- .../gatk/tools/walkers/genotyper/GenotypingEngine.java | 2 +- .../variantutils/GenotypeGVCFsIntegrationTest.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/genotyper/GenotypingEngine.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/genotyper/GenotypingEngine.java index 0a0debff9..6c1b28cb2 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/genotyper/GenotypingEngine.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/genotyper/GenotypingEngine.java @@ -210,7 +210,7 @@ public abstract class GenotypingEngine stratifiedContexts, diff --git a/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFsIntegrationTest.java b/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFsIntegrationTest.java index 049da9bba..2de0af25b 100644 --- a/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFsIntegrationTest.java +++ b/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFsIntegrationTest.java @@ -612,6 +612,15 @@ public class GenotypeGVCFsIntegrationTest extends WalkerTest { executeTest("testAlleleSpecificAnnotations_elevenSamples", spec); } + @Test + public void testMonomorphicVCwithAlt() { + final String cmd = "-T GenotypeGVCFs -R " + b37KGReference + " -G AS_Standard -o %s --no_cmdline_in_header --disableDithering -V " + + privateTestDir + "monomorphicGVCwithAlt.vcf"; + final WalkerTestSpec spec = new WalkerTestSpec(cmd, 1, Collections.singletonList("080951cdb5d4903dd58b1e753b9378d5")); + spec.disableShadowBCF(); + executeTest("testAlleleSpecificAnnotations", spec); + } + @Test public void testFractionInformativeReads() { final String cmd = "-T GenotypeGVCFs -R " + b37KGReference + " -G AS_Standard -o %s --no_cmdline_in_header -A FractionInformativeReads --disableDithering -V "