From e24f7fec474da55846f8546a99c68df381358e10 Mon Sep 17 00:00:00 2001 From: delangel Date: Fri, 22 Oct 2010 15:17:11 +0000 Subject: [PATCH] Fixed indel genotyper which broke yet again because we can't just call context.getBasePileup() without checking again for its existence in the first place. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4553 348d0f76-0448-11de-a6fe-93d51630548a --- .../walkers/genotyper/UnifiedGenotyperEngine.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 76e4617a5..f984741a9 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 @@ -371,7 +371,18 @@ public class UnifiedGenotyperEngine { if ( ignoreCoveredSamples && isCovered ) continue; - int depth = isCovered ? contexts.get(sample).getContext(StratifiedAlignmentContext.StratifiedContextType.COMPLETE).getBasePileup().size() : 0; + + int depth = 0; + + if (isCovered) { + AlignmentContext context = contexts.get(sample).getContext(StratifiedAlignmentContext.StratifiedContextType.COMPLETE); + + if (context.hasBasePileup()) + depth = context.getBasePileup().size(); + else if (context.hasExtendedEventPileup()) + depth = context.getExtendedEventPileup().size(); + } + P_of_ref *= 1.0 - (theta / 2.0) * MathUtils.binomialProbability(0, depth, 0.5); }