Added a -summary jexl argument to VariantEval similar to -validate.
Updated the package of ValidationGenotyper to match the file location. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4710 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
8dca5bd861
commit
c723db1f4b
|
|
@ -126,6 +126,10 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> implements Tr
|
||||||
@Argument(shortName="selectName", doc="Names to use for the list of stratifications (must be a 1-to-1 mapping)", required=false)
|
@Argument(shortName="selectName", doc="Names to use for the list of stratifications (must be a 1-to-1 mapping)", required=false)
|
||||||
protected ArrayList<String> SELECT_NAMES = new ArrayList<String>();
|
protected ArrayList<String> SELECT_NAMES = new ArrayList<String>();
|
||||||
|
|
||||||
|
@Hidden
|
||||||
|
@Argument(shortName="summary", doc="One or more JEXL staments to log after evaluating the data", required=false)
|
||||||
|
protected ArrayList<String> SUMMARY_EXPS = new ArrayList<String>();
|
||||||
|
|
||||||
@Hidden
|
@Hidden
|
||||||
@Argument(shortName="validate", doc="One or more JEXL validations to use after evaluating the data", required=false)
|
@Argument(shortName="validate", doc="One or more JEXL validations to use after evaluating the data", required=false)
|
||||||
protected ArrayList<String> VALIDATE_EXPS = new ArrayList<String>();
|
protected ArrayList<String> VALIDATE_EXPS = new ArrayList<String>();
|
||||||
|
|
@ -483,12 +487,12 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> implements Tr
|
||||||
private Set<VariantEvaluator> instantiateEvalationsSet() {
|
private Set<VariantEvaluator> instantiateEvalationsSet() {
|
||||||
Set<VariantEvaluator> evals = new HashSet<VariantEvaluator>();
|
Set<VariantEvaluator> evals = new HashSet<VariantEvaluator>();
|
||||||
Object[] args = new Object[]{this};
|
Object[] args = new Object[]{this};
|
||||||
Class[] argTypes = new Class[]{this.getClass()};
|
Class<?>[] argTypes = new Class<?>[]{VariantEvalWalker.class};
|
||||||
|
|
||||||
for ( Class c : evaluationClasses ) {
|
for ( Class<? extends VariantEvaluator> c : evaluationClasses ) {
|
||||||
try {
|
try {
|
||||||
Constructor constructor = c.getConstructor(argTypes);
|
Constructor<? extends VariantEvaluator> constructor = c.getConstructor(argTypes);
|
||||||
VariantEvaluator eval = (VariantEvaluator)constructor.newInstance(args);
|
VariantEvaluator eval = constructor.newInstance(args);
|
||||||
evals.add(eval);
|
evals.add(eval);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new DynamicClassResolutionException(c, e);
|
throw new DynamicClassResolutionException(c, e);
|
||||||
|
|
@ -804,7 +808,7 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> implements Tr
|
||||||
* Validates the JEXL expressions and throws an exception if they do not all return true.
|
* Validates the JEXL expressions and throws an exception if they do not all return true.
|
||||||
*/
|
*/
|
||||||
private void validateContext() {
|
private void validateContext() {
|
||||||
if (VALIDATE_EXPS.size() == 0)
|
if (SUMMARY_EXPS.size() + VALIDATE_EXPS.size() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
JexlContext jc = new MapContext();
|
JexlContext jc = new MapContext();
|
||||||
|
|
@ -833,6 +837,11 @@ public class VariantEvalWalker extends RodWalker<Integer, Integer> implements Tr
|
||||||
|
|
||||||
JexlEngine jexl = new JexlEngine(uberspect, null, null, null);
|
JexlEngine jexl = new JexlEngine(uberspect, null, null, null);
|
||||||
|
|
||||||
|
for (String expression: SUMMARY_EXPS) {
|
||||||
|
Object jexlResult = jexl.createExpression(expression).evaluate(jc);
|
||||||
|
logger.info("Summary: " + expression + " = " + jexlResult);
|
||||||
|
}
|
||||||
|
|
||||||
List<String> failedExpressions = new ArrayList<String>();
|
List<String> failedExpressions = new ArrayList<String>();
|
||||||
for (String expression: VALIDATE_EXPS) {
|
for (String expression: VALIDATE_EXPS) {
|
||||||
// ex: evalYRI.compYRI.all.called.novel.titv.tiTvRatio > 1.0
|
// ex: evalYRI.compYRI.all.called.novel.titv.tiTvRatio > 1.0
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.validationgenotyper;
|
package org.broadinstitute.sting.playground.gatk.walkers;
|
||||||
|
|
||||||
import org.broad.tribble.util.variantcontext.VariantContext;
|
import org.broad.tribble.util.variantcontext.VariantContext;
|
||||||
import org.broadinstitute.sting.commandline.Output;
|
import org.broadinstitute.sting.commandline.Output;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue