From 902cf84448fb52a22d25f0ea7cd52a6dddb00d49 Mon Sep 17 00:00:00 2001 From: ebanks Date: Fri, 13 Nov 2009 04:10:32 +0000 Subject: [PATCH] Bug fix: if the most likely allele frequency is 0, don't make a variant call (even if the Qscore for AF=1/n > threshold) git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2033 348d0f76-0448-11de-a6fe-93d51630548a --- .../genotyper/JointEstimateGenotypeCalculationModel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/JointEstimateGenotypeCalculationModel.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/JointEstimateGenotypeCalculationModel.java index aa227afd5..1d16ee6e5 100644 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/JointEstimateGenotypeCalculationModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/JointEstimateGenotypeCalculationModel.java @@ -293,9 +293,10 @@ public class JointEstimateGenotypeCalculationModel extends GenotypeCalculationMo } double phredScaledConfidence = -10.0 * Math.log10(alleleFrequencyPosteriors[indexOfMax][0]); + int bestAFguess = findMaxEntry(alleleFrequencyPosteriors[indexOfMax]).second; - // return a null call if we don't pass the confidence cutoff - if ( !ALL_BASE_MODE && phredScaledConfidence < CONFIDENCE_THRESHOLD ) + // return a null call if we don't pass the confidence cutoff or the most likely allele frequency is zero + if ( !ALL_BASE_MODE && (bestAFguess == 0 || phredScaledConfidence < CONFIDENCE_THRESHOLD) ) return new Pair, GenotypeLocusData>(null, null); ArrayList calls = new ArrayList(); @@ -331,7 +332,6 @@ public class JointEstimateGenotypeCalculationModel extends GenotypeCalculationMo ((ConfidenceBacked)locusdata).setConfidence(phredScaledConfidence); } if ( locusdata instanceof AlleleFrequencyBacked ) { - int bestAFguess = findMaxEntry(alleleFrequencyPosteriors[indexOfMax]).second; ((AlleleFrequencyBacked)locusdata).setAlleleFrequency((double)bestAFguess / (double)(frequencyEstimationPoints-1)); AlleleFrequencyBacked.AlleleFrequencyRange range = computeAFrange(alleleFrequencyPosteriors[indexOfMax], frequencyEstimationPoints-1, bestAFguess, ALLELE_FREQUENCY_RANGE); ((AlleleFrequencyBacked)locusdata).setAlleleFrequencyRange(range);