From a74e571fe24975d86c9a447f9f6b6f04c61ea268 Mon Sep 17 00:00:00 2001 From: Ron Levine Date: Fri, 11 Jan 2019 13:55:53 -0500 Subject: [PATCH] Add warning message to add allele specific annotation group (#3042) --- .../walkers/ReferenceConfidenceVariantContextMerger.java | 4 ++++ .../hellbender/utils/variant/GATKVCFConstants.java | 1 + .../org/broadinstitute/hellbender/testutils/BaseTest.java | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/ReferenceConfidenceVariantContextMerger.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/ReferenceConfidenceVariantContextMerger.java index 6e60578b026..6163cfa53ed 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/ReferenceConfidenceVariantContextMerger.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/ReferenceConfidenceVariantContextMerger.java @@ -34,6 +34,7 @@ public final class ReferenceConfidenceVariantContextMerger { protected final VariantAnnotatorEngine annotatorEngine; protected final OneShotLogger oneShotAnnotationLogger = new OneShotLogger(this.getClass()); protected final OneShotLogger oneShotHeaderLineLogger = new OneShotLogger(this.getClass()); + protected final OneShotLogger AS_Warning = new OneShotLogger(this.getClass()); public ReferenceConfidenceVariantContextMerger(VariantAnnotatorEngine engine, final VCFHeader inputHeader) { Utils.nonNull(inputHeader, "A VCF header must be provided"); @@ -391,6 +392,9 @@ private void addReferenceConfidenceAttributes(final VCWithNewAlleles vcPair, fin values.add(parseNumericInfoAttributeValue(vcfInputHeader, key, value.toString())); } catch (final NumberFormatException e) { oneShotAnnotationLogger.warn(String.format("Detected invalid annotations: When trying to merge variant contexts at location %s:%d the annotation %s was not a numerical value and was ignored",vcPair.getVc().getContig(),vcPair.getVc().getStart(),p.toString())); + if (key.startsWith(GATKVCFConstants.ALLELE_SPECIFIC_ANNOTATION_PREFIX)) { + AS_Warning.warn(String.format("Reducible annotation '%s' detected, add -G Standard -G AS_Standard to the command to annotate in the final VC with this annotation.",key)); + } } } } diff --git a/src/main/java/org/broadinstitute/hellbender/utils/variant/GATKVCFConstants.java b/src/main/java/org/broadinstitute/hellbender/utils/variant/GATKVCFConstants.java index 1ed02d90f2c..c54237321c7 100644 --- a/src/main/java/org/broadinstitute/hellbender/utils/variant/GATKVCFConstants.java +++ b/src/main/java/org/broadinstitute/hellbender/utils/variant/GATKVCFConstants.java @@ -185,6 +185,7 @@ their names (or descriptions) depend on some threshold. Those filters are not i public final static String NON_REF_SYMBOLIC_ALLELE_NAME = "NON_REF"; public final static String SPANNING_DELETION_SYMBOLIC_ALLELE_NAME_DEPRECATED = "*:DEL"; public final static Allele SPANNING_DELETION_SYMBOLIC_ALLELE_DEPRECATED = Allele.create("<" + SPANNING_DELETION_SYMBOLIC_ALLELE_NAME_DEPRECATED + ">", false); // represents any possible spanning deletion allele at this si + public static final String ALLELE_SPECIFIC_ANNOTATION_PREFIX = "AS"; public static boolean isSpanningDeletion(final Allele allele){ diff --git a/src/testUtils/java/org/broadinstitute/hellbender/testutils/BaseTest.java b/src/testUtils/java/org/broadinstitute/hellbender/testutils/BaseTest.java index 787dd7b3ccc..306b1598442 100644 --- a/src/testUtils/java/org/broadinstitute/hellbender/testutils/BaseTest.java +++ b/src/testUtils/java/org/broadinstitute/hellbender/testutils/BaseTest.java @@ -394,7 +394,7 @@ private static String captureSystemStream(Runnable runnable, PrintStream stream } public static void assertContains(String actual, String expectedSubstring){ - Assert.assertTrue(actual.contains(expectedSubstring), expectedSubstring +" was not found in " + actual+ "."); + Assert.assertTrue(actual.contains(expectedSubstring), expectedSubstring +" was not found in " + actual + "."); } public static void assertCondition(Iterable actual, Iterable expected, BiConsumer assertion){