From 6b960bd9c5fb54c6b618fcd61edab6378824b634 Mon Sep 17 00:00:00 2001 From: ebanks Date: Sun, 11 Jul 2010 04:30:15 +0000 Subject: [PATCH] Fix for Steve: genotype filters still want to see the values from the VC git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3758 348d0f76-0448-11de-a6fe-93d51630548a --- .../variantcontext/VariantContextUtils.java | 16 +++++++++------- .../walkers/filters/VariantFiltrationWalker.java | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/contexts/variantcontext/VariantContextUtils.java b/java/src/org/broadinstitute/sting/gatk/contexts/variantcontext/VariantContextUtils.java index c458e093b..ab51b0918 100755 --- a/java/src/org/broadinstitute/sting/gatk/contexts/variantcontext/VariantContextUtils.java +++ b/java/src/org/broadinstitute/sting/gatk/contexts/variantcontext/VariantContextUtils.java @@ -130,27 +130,29 @@ public class VariantContextUtils { } /** - * Returns true if exp match VC. See collection<> version for full docs. + * Returns true if exp match VC/g. See collection<> version for full docs. + * @param vc variant context * @param g genotype * @param exp expression * @return true if there is a match */ - public static boolean match(Genotype g, JexlVCMatchExp exp) { - return match(g,Arrays.asList(exp)).get(exp); + public static boolean match(VariantContext vc, Genotype g, JexlVCMatchExp exp) { + return match(vc,g,Arrays.asList(exp)).get(exp); } /** - * Matches each JexlVCMatchExp exp against the data contained in vc, and returns a map from these + * Matches each JexlVCMatchExp exp against the data contained in vc/g, and returns a map from these * expressions to true (if they matched) or false (if they didn't). This the best way to apply JEXL - * expressions to VariantContext records. Use initializeMatchExps() to create the list of JexlVCMatchExp + * expressions to VariantContext records/genotypes. Use initializeMatchExps() to create the list of JexlVCMatchExp * expressions. * + * @param vc variant context * @param g genotype * @param exps expressions * @return true if there is a match */ - public static Map match(Genotype g, Collection exps) { - return new JEXLMap(exps,g); + public static Map match(VariantContext vc, Genotype g, Collection exps) { + return new JEXLMap(exps,vc,g); } diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationWalker.java b/java/src/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationWalker.java index 18219ad72..f6cfaa37f 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationWalker.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/filters/VariantFiltrationWalker.java @@ -183,7 +183,7 @@ public class VariantFiltrationWalker extends RodWalker { Set filters = new LinkedHashSet(g.getFilters()); for ( VariantContextUtils.JexlVCMatchExp exp : genotypeFilterExps ) { - if ( VariantContextUtils.match(g, exp) ) + if ( VariantContextUtils.match(vc, g, exp) ) filters.add(exp.name); }