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
This commit is contained in:
ebanks 2011-04-14 20:11:17 +00:00
parent 8e0f5bc5a5
commit 2830dc70b7
2 changed files with 5 additions and 3 deletions

View File

@ -103,7 +103,8 @@ public class UGCalcLikelihoods extends LocusWalker<VariantCallContext, Integer>
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; }

View File

@ -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<String, AlignmentContext> stratifiedContexts = getFilteredAndStratifiedContexts(UAC, refContext, rawContext, model);
if ( stratifiedContexts == null )
return null;
return calculateLikelihoods(tracker, refContext, stratifiedContexts, AlignmentContextUtils.ReadOrientation.COMPLETE, alternateAlleleToUse, useBAQedPileup, model);
}