Skip to content

Commit

Permalink
Add warning message to add allele specific annotation group (#3042)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronlevine authored and jamesemery committed Jan 11, 2019
1 parent c3e9818 commit a74e571
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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));
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <T> void assertCondition(Iterable<T> actual, Iterable<T> expected, BiConsumer<T,T> assertion){
Expand Down

0 comments on commit a74e571

Please sign in to comment.