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
This commit is contained in:
delangel 2010-10-22 15:17:11 +00:00
parent c0b4317311
commit e24f7fec47
1 changed files with 12 additions and 1 deletions

View File

@ -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);
}