Skip to content

Commit

Permalink
SelectVariants JEXL filter fixes and refactor (#8092)
Browse files Browse the repository at this point in the history
SelectVariants improvements: more documentation, more tests, refactoring, a new argument --select-genotype.
  • Loading branch information
takutosato authored Jan 7, 2023
1 parent 9ced727 commit 9f77b1f
Show file tree
Hide file tree
Showing 4 changed files with 592 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ private VariantContext filter(final VariantContext variant, final FeatureContext
}

for ( final JexlVCMatchExp exp : filterExps ) {
// Note that g is set to null since filterExps contains INFO-level filters
if ( matchesFilter(vc, null, exp, invertFilterExpression) ) {
filters.add(exp.name);
}
Expand Down Expand Up @@ -437,6 +438,7 @@ private List<String> getGenotypeFilters(final VariantContext vc, final Genotype

// Add if expression filters the variant context
for (final JexlVCMatchExp exp : genotypeFilterExps) {
// Give the genotype g to mathchesFilter enables JEXL matching on genotype fields
if (matchesFilter(vc, g, exp, invertGenotypeFilterExpression)) {
filters.add(exp.name);
}
Expand Down
Loading

0 comments on commit 9f77b1f

Please sign in to comment.