From 5971006678b5c3b2884bafed974c596e009c76e7 Mon Sep 17 00:00:00 2001 From: Guillermo del Angel Date: Fri, 12 Oct 2012 12:45:55 -0400 Subject: [PATCH] Bug fix when running nondiploid mode in UG with EMIT_ALL_SITES: if site was reference-only, QUAL is produced OK but genotypes were being set to no-call because of unnecessary likelihood normalization. May change integration test md5 which I'll fix later today --- .../walkers/genotyper/GeneralPloidyExactAFCalculation.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidyExactAFCalculation.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidyExactAFCalculation.java index da3ed2a02..b0452f9ea 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidyExactAFCalculation.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/GeneralPloidyExactAFCalculation.java @@ -627,7 +627,10 @@ public class GeneralPloidyExactAFCalculation extends ExactAFCalculation { // create the new likelihoods array from the alleles we are allowed to use final double[] originalLikelihoods = g.getLikelihoods().getAsVector(); double[] newLikelihoods; - if ( numOriginalAltAlleles == numNewAltAlleles) { + + // Optimization: if # of new alt alleles = 0 (pure ref call), keep original likelihoods so we skip normalization + // and subsetting + if ( numOriginalAltAlleles == numNewAltAlleles || numNewAltAlleles == 0) { newLikelihoods = originalLikelihoods; } else { newLikelihoods = GeneralPloidyGenotypeLikelihoods.subsetToAlleles(originalLikelihoods, ploidy, vc.getAlleles(), allelesToUse);