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
This commit is contained in:
ebanks 2009-12-04 04:45:05 +00:00
parent b05e73a914
commit 58937bf9ba
3 changed files with 17 additions and 1 deletions

View File

@ -176,12 +176,21 @@ public class VariantAnnotator extends RodWalker<Integer, Integer> {
return 1;
}
// option #1: don't specify annotations to be used: standard annotations are used by default
public static Map<String, String> getAnnotations(ReferenceContext ref, AlignmentContext context, Variation variation, List<Genotype> 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<String, String> getAllAnnotations(ReferenceContext ref, AlignmentContext context, Variation variation, List<Genotype> 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<String, String> getAnnotations(ReferenceContext ref, AlignmentContext context, Variation variation, List<Genotype> genotypes, Collection<VariantAnnotation> annotations) {
// set up the pileup for the full collection of reads at this position

View File

@ -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)

View File

@ -172,7 +172,11 @@ public class UnifiedGenotyper extends LocusWalker<Pair<List<Genotype>, GenotypeL
// annotate the call, if possible
if ( call != null && call.second != null && call.second instanceof ArbitraryFieldsBacked ) {
Map<String, String> annotations = VariantAnnotator.getAnnotations(refContext, fullContext, call.second, call.first);
Map<String, String> 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);
}