From 2830dc70b7c6dde5df797477b671169192eca241 Mon Sep 17 00:00:00 2001 From: ebanks Date: Thu, 14 Apr 2011 20:11:17 +0000 Subject: [PATCH] UG can still return null in certain nasty cases git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5642 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/walkers/genotyper/UGCalcLikelihoods.java | 3 ++- .../sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UGCalcLikelihoods.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UGCalcLikelihoods.java index edbb1c2db..f3f48f501 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UGCalcLikelihoods.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UGCalcLikelihoods.java @@ -103,7 +103,8 @@ public class UGCalcLikelihoods extends LocusWalker return null; } - return new VariantCallContext(UG_engine.calculateLikelihoods(tracker, refContext, rawContext, vc.getAlternateAllele(0), true), refContext.getBase(), true); + VariantContext call = UG_engine.calculateLikelihoods(tracker, refContext, rawContext, vc.getAlternateAllele(0), true); + return call == null ? null : new VariantCallContext(call, refContext.getBase(), true); } public Integer reduceInit() { return 0; } 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 a89ce0ba0..b3ff6af80 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java @@ -175,12 +175,13 @@ public class UnifiedGenotyperEngine { */ public VariantContext calculateLikelihoods(RefMetaDataTracker tracker, ReferenceContext refContext, AlignmentContext rawContext, Allele alternateAlleleToUse, boolean useBAQedPileup) { final GenotypeLikelihoodsCalculationModel.Model model = getCurrentGLModel( rawContext ); - if( model == null ) { + if( model == null ) return null; - } + Map stratifiedContexts = getFilteredAndStratifiedContexts(UAC, refContext, rawContext, model); if ( stratifiedContexts == null ) return null; + return calculateLikelihoods(tracker, refContext, stratifiedContexts, AlignmentContextUtils.ReadOrientation.COMPLETE, alternateAlleleToUse, useBAQedPileup, model); }