From da6a07ad3b29574ea4eb7890066e251a384f0c76 Mon Sep 17 00:00:00 2001 From: delangel Date: Fri, 3 Dec 2010 02:48:09 +0000 Subject: [PATCH] First round of critical fixes to indel genotyper (more to come tomorrow): a) Avoid complete crash of caller that broke due to a recent refactoring by someone who must not be named EB... an integration test to avoid this in the future coming soon. b) Fixed up strand bias computation for indels git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4779 348d0f76-0448-11de-a6fe-93d51630548a --- .../genotyper/DindelGenotypeLikelihoodsCalculationModel.java | 3 ++- .../sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DindelGenotypeLikelihoodsCalculationModel.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DindelGenotypeLikelihoodsCalculationModel.java index 2e9da3595..3690ae8dc 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DindelGenotypeLikelihoodsCalculationModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DindelGenotypeLikelihoodsCalculationModel.java @@ -88,7 +88,8 @@ public class DindelGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoo if (!vc.isIndel()) return null; - if (sitesVisited.contains(new Integer(vc.getStart()))) + if (sitesVisited.contains(new Integer(vc.getStart())) && + contextType.equals(StratifiedAlignmentContext.StratifiedContextType.COMPLETE)) return null; sitesVisited.add(new Integer(vc.getStart())); diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java index 84a4ffed7..c0d0c061c 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java @@ -177,7 +177,10 @@ public class UnifiedGenotyperEngine { Map GLs = new HashMap(); Allele refAllele = glcm.get().getLikelihoods(tracker, refContext, stratifiedContexts, type, genotypePriors, GLs); - return createVariantContextFromLikelihoods(refContext, refAllele, GLs); + if (refAllele != null) + return createVariantContextFromLikelihoods(refContext, refAllele, GLs); + else + return null; } private VariantContext createVariantContextFromLikelihoods(ReferenceContext refContext, Allele refAllele, Map GLs) {