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
This commit is contained in:
ebanks 2010-07-11 04:30:15 +00:00
parent 1d399aa2f3
commit 6b960bd9c5
2 changed files with 10 additions and 8 deletions

View File

@ -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<JexlVCMatchExp, Boolean> match(Genotype g, Collection<JexlVCMatchExp> exps) {
return new JEXLMap(exps,g);
public static Map<JexlVCMatchExp, Boolean> match(VariantContext vc, Genotype g, Collection<JexlVCMatchExp> exps) {
return new JEXLMap(exps,vc,g);
}

View File

@ -183,7 +183,7 @@ public class VariantFiltrationWalker extends RodWalker<Integer, Integer> {
Set<String> filters = new LinkedHashSet<String>(g.getFilters());
for ( VariantContextUtils.JexlVCMatchExp exp : genotypeFilterExps ) {
if ( VariantContextUtils.match(g, exp) )
if ( VariantContextUtils.match(vc, g, exp) )
filters.add(exp.name);
}