diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFs.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFs.java index 53a2f1790..b298ba25c 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFs.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFs.java @@ -64,9 +64,12 @@ import org.broadinstitute.gatk.engine.walkers.Reference; import org.broadinstitute.gatk.engine.walkers.RodWalker; import org.broadinstitute.gatk.engine.walkers.TreeReducible; import org.broadinstitute.gatk.engine.walkers.Window; +import org.broadinstitute.gatk.tools.walkers.annotator.RankSumTest; +import org.broadinstitute.gatk.tools.walkers.annotator.RMSAnnotation; import org.broadinstitute.gatk.tools.walkers.annotator.VariantAnnotatorEngine; import org.broadinstitute.gatk.tools.walkers.annotator.interfaces.AS_StandardAnnotation; import org.broadinstitute.gatk.tools.walkers.annotator.interfaces.AnnotatorCompatible; +import org.broadinstitute.gatk.tools.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.gatk.tools.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.gatk.tools.walkers.genotyper.OutputMode; import org.broadinstitute.gatk.tools.walkers.genotyper.UnifiedArgumentCollection; @@ -188,6 +191,8 @@ public class GenotypeGVCFs extends RodWalker infoFieldAnnotationKeyNamesToRemove = new ArrayList<>(); public List> getCompRodBindings() { return Collections.emptyList(); } public RodBinding getSnpEffRodBinding() { return null; } @@ -223,6 +228,16 @@ public class GenotypeGVCFs extends RodWalkeremptyList(), this, toolkit); + // Request INFO field annotations inheriting from RankSumTest and RMSAnnotation added to remove list + for ( final InfoFieldAnnotation annotation : annotationEngine.getRequestedInfoAnnotations() ) { + if ( annotation instanceof RankSumTest || annotation instanceof RMSAnnotation ) { + final List keyNames = annotation.getKeyNames(); + if ( !keyNames.isEmpty() ) { + infoFieldAnnotationKeyNamesToRemove.add(keyNames.get(0)); + } + } + } + // create the genotyping engine // when checking for presence of AS_StandardAnnotation we must deal with annoying feature that // the class name with or without the trailing "Annotation" are both valid command lines @@ -321,7 +336,6 @@ public class GenotypeGVCFs extends RodWalker cleanupGenotypeAnnotations(final VariantContext VC, final boolean createRefGTs) { - final GenotypesContext oldGTs = VC.getGenotypes(); + private List cleanupGenotypeAnnotations(final VariantContext vc, final boolean createRefGTs) { + final GenotypesContext oldGTs = vc.getGenotypes(); final List recoveredGs = new ArrayList<>(oldGTs.size()); + for ( final Genotype oldGT : oldGTs ) { final Map attrs = new HashMap<>(oldGT.getExtendedAttributes()); @@ -455,15 +494,15 @@ public class GenotypeGVCFs extends RodWalker refAlleles = Collections.nCopies(ploidy,VC.getReference()); + final List refAlleles = Collections.nCopies(ploidy,vc.getReference()); //keep 0 depth samples and 0 GQ samples as no-call if (depth > 0 && oldGT.hasGQ() && oldGT.getGQ() > 0) { 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 47e813204..891705794 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 @@ -251,7 +251,7 @@ public class GenotypeGVCFsIntegrationTest extends WalkerTest { final WalkerTestSpec spec = new WalkerTestSpec( baseBPResolutionString("-allSites"), 1, - Collections.singletonList("77924e6b958a30f954e1c3a9f504a6a7")); + Collections.singletonList("764ac46e0b985db187d85655240f7ec0")); spec.disableShadowBCF(); executeTest("testAllSitesNonBiallelic", spec); } @@ -685,9 +685,19 @@ public class GenotypeGVCFsIntegrationTest extends WalkerTest { @Test public void testNewQualNaNBugFix() { final WalkerTestSpec spec = new WalkerTestSpec( - baseTestString(" -newQual -V " + privateTestDir + "input-newqual-nan-bug-fix.vcf", b37KGReferenceWithDecoy), + baseTestString(" -newQual -V " + privateTestDir + "input-newqual-nan-bug-fix.vcf", b37KGReferenceWithDecoy), Collections.singletonList("503f4193c22fbcc451bd1c425b8b6bf8")); spec.disableShadowBCF(); executeTest("testNewQualNaNBugFix", spec); } + + @Test + public void testHomRefHighMQ() { + final WalkerTestSpec spec = new WalkerTestSpec( + baseTestString(" -V " + privateTestDir + "NA18503.22.vcf -V " + privateTestDir + "NA18504.22.vcf -V " + + privateTestDir + "NA18505.22.vcf -allSites", b37KGReference), + Collections.singletonList("6d253024246e1024b9b6e8f885f53799")); + spec.disableShadowBCF(); + executeTest("testHomRefHighMQ", spec); + } } \ No newline at end of file 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 193c01120..e978037b7 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 @@ -62,6 +62,15 @@ public class VariantAnnotatorEngine { // Map of info field name to info field private final Map hInfoMap = new HashMap<>(); + /** + * Get the requested INFO field annotations + * + * @return requested INFO field annotations + */ + public List getRequestedInfoAnnotations() { + return requestedInfoAnnotations; + } + protected static class VAExpression { public String fullName, fieldName;