From d82d6c0665a1b3e9524619805f32a0f67fd9a035 Mon Sep 17 00:00:00 2001 From: kiran Date: Wed, 9 Sep 2009 17:34:16 +0000 Subject: [PATCH] Excludes variants that fall below a certain LOD that changes as a function of depth. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1564 348d0f76-0448-11de-a6fe-93d51630548a --- .../filters/VECLodThresholdByCoverage.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 java/src/org/broadinstitute/sting/gatk/walkers/filters/VECLodThresholdByCoverage.java diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/filters/VECLodThresholdByCoverage.java b/java/src/org/broadinstitute/sting/gatk/walkers/filters/VECLodThresholdByCoverage.java new file mode 100755 index 000000000..d9d00431f --- /dev/null +++ b/java/src/org/broadinstitute/sting/gatk/walkers/filters/VECLodThresholdByCoverage.java @@ -0,0 +1,39 @@ +package org.broadinstitute.sting.gatk.walkers.filters; + +import java.util.HashMap; + +public class VECLodThresholdByCoverage implements VariantExclusionCriterion { + private double slope = 0.46; + private double depth; + private double lod; + private boolean exclude; + + public void initialize(HashMap arguments) { + if (arguments.get("slope") != null) { + slope = Double.valueOf(arguments.get("slope")); + } + } + + public void compute(VariantContextWindow contextWindow) { + depth = (double) contextWindow.getContext().getVariant().getPileupDepth(); + lod = contextWindow.getContext().getVariant().getLodBtr(); + + exclude = (lod < slope*depth); + } + + public double inclusionProbability() { + return exclude ? 0.0 : 1.0; + } + + public String getStudyHeader() { + return String.format("LodThresholdByCoverage(%f)\tdepth\tlod", slope); + } + + public String getStudyInfo() { + return String.format("%s\t%d\t%f", exclude ? "fail" : "pass", (int) depth, lod); + } + + public boolean useZeroQualityReads() { + return false; + } +}