From d41c252b131b3afc82295afd8247291094882a13 Mon Sep 17 00:00:00 2001 From: ebanks Date: Thu, 14 Oct 2010 19:06:32 +0000 Subject: [PATCH] Looking over the calling results with Ryan, it's clear that while the grid search optimization (ignoring samples that are clearly ref) can work for assigning genotypes, it cannot be used for calculating P(AF>0). There's too much area under the likelihood curve that gets lost and the QUALs are negatively affected. However, testing showed that this only slightly affects runtime (~15 minutes per 1Mbase for the 1kg allpops). The optimization does remain for genotyping. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4498 348d0f76-0448-11de-a6fe-93d51630548a --- .../walkers/genotyper/AlleleFrequencyCalculationModel.java | 7 +++++-- .../gatk/walkers/genotyper/ExactAFCalculationModel.java | 2 +- .../gatk/walkers/genotyper/GridSearchAFEstimation.java | 2 +- 3 files changed, 7 insertions(+), 4 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 2b84e02a6..730b9de93 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 @@ -63,10 +63,13 @@ public abstract class AlleleFrequencyCalculationModel implements Cloneable { protected Logger logger; protected PrintStream verboseWriter; - protected AlleleFrequencyCalculationModel(int N, Logger logger, PrintStream verboseWriter) { + protected boolean useReferenceSampleOptimization; + + protected AlleleFrequencyCalculationModel(int N, Logger logger, PrintStream verboseWriter, boolean useReferenceSampleOptimization) { this.N = N; this.logger = logger; this.verboseWriter = verboseWriter; + this.useReferenceSampleOptimization = useReferenceSampleOptimization; AFMatrix = new AlleleFrequencyMatrix(N); refCalls = new HashSet(); } @@ -171,7 +174,7 @@ public abstract class AlleleFrequencyCalculationModel implements Cloneable { AFMatrix.clear(); for ( BiallelicGenotypeLikelihoods GL : GLs.values() ) { - if ( isClearRefCall(GL) ) { + if ( useReferenceSampleOptimization && isClearRefCall(GL) ) { refCalls.add(GL); } else { AFMatrix.setLikelihoods(GL.getPosteriors(), GL.getSample()); diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/ExactAFCalculationModel.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/ExactAFCalculationModel.java index 20b53c185..dfa455a69 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/ExactAFCalculationModel.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/ExactAFCalculationModel.java @@ -47,7 +47,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel { private static final double LOGEPS = -300; protected ExactAFCalculationModel(int N, Logger logger, PrintStream verboseWriter) { - super(N, logger, verboseWriter); + super(N, logger, verboseWriter, true); } public void getLog10PNonRef(RefMetaDataTracker tracker, 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 6977fb0d8..edef58d13 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 @@ -41,7 +41,7 @@ public class GridSearchAFEstimation extends AlleleFrequencyCalculationModel { protected static final double LOG10_OPTIMIZATION_EPSILON = 8.0; protected GridSearchAFEstimation(int N, Logger logger, PrintStream verboseWriter) { - super(N, logger, verboseWriter); + super(N, logger, verboseWriter, false); } public void getLog10PNonRef(RefMetaDataTracker tracker,