From 31ee8aa01a6b752f5a22af226682950424003890 Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Thu, 21 Jun 2012 09:54:36 -0400 Subject: [PATCH] JEXL update -- Update to 2.1.1 from 2.0 -- VariantFiltrationWalker now allows you to run with type unsafe selects, which all default to false when matching. So "AF < 0.5" works even in the presence of multi-allelics now. -- --- ivy.xml | 2 +- .../sting/utils/variantcontext/VariantContextUtils.java | 5 +++-- .../sting/utils/variantcontext/VariantJEXLContext.java | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ivy.xml b/ivy.xml index 9cc92d890..f76880b94 100644 --- a/ivy.xml +++ b/ivy.xml @@ -59,7 +59,7 @@ - + diff --git a/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContextUtils.java b/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContextUtils.java index 099c3d541..e2c30913f 100755 --- a/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContextUtils.java +++ b/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantContextUtils.java @@ -52,8 +52,9 @@ public class VariantContextUtils { private final static boolean ASSUME_MISSING_FIELDS_ARE_STRINGS = false; static { - engine.setSilent(false); // will throw errors now for selects that don't evaluate properly - engine.setLenient(false); + engine.setSilent(true); // will throw errors now for selects that don't evaluate properly + engine.setLenient(true); + engine.setDebug(false); } /** diff --git a/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantJEXLContext.java b/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantJEXLContext.java index 6ecb898df..e25599812 100644 --- a/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantJEXLContext.java +++ b/public/java/src/org/broadinstitute/sting/utils/variantcontext/VariantJEXLContext.java @@ -264,7 +264,9 @@ class JEXLMap implements Map { // if the context is null, we need to create it to evaluate the JEXL expression if (this.jContext == null) createContext(); try { - jexl.put (exp, (Boolean) exp.exp.evaluate(jContext)); + final Boolean value = (Boolean) exp.exp.evaluate(jContext); + // treat errors as no match + jexl.put(exp, value == null ? false : value); } catch (Exception e) { throw new UserException.CommandLineException(String.format("Invalid JEXL expression detected for %s with message %s", exp.name, e.getMessage())); }