From fd8351cd4969066479832bc547e4517b7cfdefc3 Mon Sep 17 00:00:00 2001 From: ebanks Date: Mon, 11 Oct 2010 04:04:07 +0000 Subject: [PATCH] Get rid of useless test/'optimization' that was carried over from UGv1. New codde is (minimally) faster with same results. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4478 348d0f76-0448-11de-a6fe-93d51630548a --- .../genotyper/AlleleFrequencyCalculationModel.java | 11 ----------- .../walkers/genotyper/GridSearchAFEstimation.java | 5 +---- .../walkers/genotyper/UnifiedGenotyperEngine.java | 7 ------- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/AlleleFrequencyCalculationModel.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/AlleleFrequencyCalculationModel.java index 33b7e0940..cc17e9104 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/AlleleFrequencyCalculationModel.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/AlleleFrequencyCalculationModel.java @@ -61,8 +61,6 @@ public abstract class AlleleFrequencyCalculationModel implements Cloneable { protected Logger logger; protected PrintStream verboseWriter; - private int minAlleleFrequencyToTest; - protected AlleleFrequencyCalculationModel(int N, Logger logger, PrintStream verboseWriter) { this.N = N; this.logger = logger; @@ -109,15 +107,6 @@ public abstract class AlleleFrequencyCalculationModel implements Cloneable { return generateCalls(contexts, GLs, AFofMaxLikelihood); } - // TODO: get rid of this optimization, it is wrong! - protected int getMinAlleleFrequencyToTest() { - return minAlleleFrequencyToTest; - } - - protected void setMinAlleleFrequencyToTest(int minAF) { - minAlleleFrequencyToTest = minAF; - } - protected Map generateCalls(Map contexts, Map GLs, int frequency) { diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/GridSearchAFEstimation.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/GridSearchAFEstimation.java index ee19d26aa..6977fb0d8 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/GridSearchAFEstimation.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/GridSearchAFEstimation.java @@ -56,9 +56,6 @@ public class GridSearchAFEstimation extends AlleleFrequencyCalculationModel { log10AlleleFrequencyPosteriors[0] = AFMatrix.getLikelihoodsOfFrequency() + log10AlleleFrequencyPriors[0]; double maxLikelihoodSeen = log10AlleleFrequencyPosteriors[0]; - // TODO: get rid of this optimization, it is wrong! - int minAlleleFrequencyToTest = getMinAlleleFrequencyToTest(); - int maxAlleleFrequencyToTest = AFMatrix.getSamples().size() * 2; // for each minor allele frequency, calculate log10PofDgivenAFi @@ -71,7 +68,7 @@ public class GridSearchAFEstimation extends AlleleFrequencyCalculationModel { // an optimization to speed up the calculation: if we are beyond the local maximum such // that subsequent likelihoods won't factor into the confidence score, just quit - if ( i >= minAlleleFrequencyToTest && maxLikelihoodSeen - log10AlleleFrequencyPosteriors[i] > LOG10_OPTIMIZATION_EPSILON ) + if ( maxLikelihoodSeen - log10AlleleFrequencyPosteriors[i] > LOG10_OPTIMIZATION_EPSILON ) return; if ( log10AlleleFrequencyPosteriors[i] > maxLikelihoodSeen ) diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/UnifiedGenotyperEngine.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/UnifiedGenotyperEngine.java index f3a62719e..70929c268 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/UnifiedGenotyperEngine.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/UnifiedGenotyperEngine.java @@ -142,10 +142,6 @@ public class UnifiedGenotyperEngine { if ( GLs.size() == 0 ) return estimateReferenceConfidence(stratifiedContexts, genotypePriors.getHeterozygosity(), false); - // reset the optimization value and determine the p(AF>0) - // TODO: get rid of this optimization, it is wrong! - afcm.get().setMinAlleleFrequencyToTest(0); - // 'zero' out the AFs (so that we don't have to worry if not all samples have reads at this position) clearAFarray(log10AlleleFrequencyPosteriors.get()); afcm.get().getLog10PNonRef(tracker, refContext, GLs, log10AlleleFrequencyPriors, log10AlleleFrequencyPosteriors.get()); @@ -221,9 +217,6 @@ public class UnifiedGenotyperEngine { double lod = overallLog10PofF - overallLog10PofNull; //System.out.println("overallLog10PofNull=" + overallLog10PofNull + ", overallLog10PofF=" + overallLog10PofF); - // set the optimization value for the subsequent strand calculations - afcm.get().setMinAlleleFrequencyToTest(bestAFguess); - // the forward lod GLs.clear(); glcm.get().getLikelihoods(tracker, refContext, stratifiedContexts, StratifiedAlignmentContext.StratifiedContextType.FORWARD, genotypePriors, GLs);