From 58937bf9ba4a233aa3c708635bd539524ccb3c4d Mon Sep 17 00:00:00 2001 From: ebanks Date: Fri, 4 Dec 2009 04:45:05 +0000 Subject: [PATCH] You can now use the -exp flag to tell the Genotyper to include experimental annotations when it calls out to VariantAnnotator. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2256 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/walkers/annotator/VariantAnnotator.java | 9 +++++++++ .../walkers/genotyper/UnifiedArgumentCollection.java | 3 +++ .../sting/gatk/walkers/genotyper/UnifiedGenotyper.java | 6 +++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java index b15ce33dc..85d9ecfc1 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java @@ -176,12 +176,21 @@ public class VariantAnnotator extends RodWalker { return 1; } + // option #1: don't specify annotations to be used: standard annotations are used by default public static Map getAnnotations(ReferenceContext ref, AlignmentContext context, Variation variation, List genotypes) { if ( standardAnnotations == null ) determineAllAnnotations(); return getAnnotations(ref, context, variation, genotypes, standardAnnotations.values()); } + // option #2: specify that all possible annotations be used + public static Map getAllAnnotations(ReferenceContext ref, AlignmentContext context, Variation variation, List genotypes) { + if ( allAnnotations == null ) + determineAllAnnotations(); + return getAnnotations(ref, context, variation, genotypes, allAnnotations.values()); + } + + // option #3: specify the exact annotations to be used public static Map getAnnotations(ReferenceContext ref, AlignmentContext context, Variation variation, List genotypes, Collection annotations) { // set up the pileup for the full collection of reads at this position diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java index 873de5161..a092e2221 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedArgumentCollection.java @@ -60,6 +60,9 @@ public class UnifiedArgumentCollection { @Argument(fullName = "noSLOD", shortName = "nsl", doc = "If provided, we will not calculate the SLOD", required = false) public boolean NO_SLOD = false; + @Argument(fullName = "include_experimental_annotations", shortName = "exp", doc = "Annotate calls with all annotations, including experimental ones", required = false) + public boolean ALL_ANNOTATIONS = false; + // control the error modes @Argument(fullName = "assume_single_sample_reads", shortName = "single_sample", doc = "The single sample that we should assume is represented in the input bam (and therefore associate with all reads regardless of whether they have read groups)", required = false) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java index 26109849b..a90c75928 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java @@ -172,7 +172,11 @@ public class UnifiedGenotyper extends LocusWalker, GenotypeL // annotate the call, if possible if ( call != null && call.second != null && call.second instanceof ArbitraryFieldsBacked ) { - Map annotations = VariantAnnotator.getAnnotations(refContext, fullContext, call.second, call.first); + Map annotations; + if ( UAC.ALL_ANNOTATIONS ) + annotations = VariantAnnotator.getAllAnnotations(refContext, fullContext, call.second, call.first); + else + annotations = VariantAnnotator.getAnnotations(refContext, fullContext, call.second, call.first); ((ArbitraryFieldsBacked)call.second).setFields(annotations); }