Fix corner condition that happens when there are indels right at the end of a contig and there's not enough reference to build a haplotype.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4996 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
delangel 2011-01-13 21:08:22 +00:00
parent c0031b05ff
commit 00310c05bb
1 changed files with 3 additions and 0 deletions

View File

@ -292,6 +292,9 @@ public class DindelGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoo
if (loc.getStart() <= HAPLOTYPE_SIZE)
return null;
// check if there is enough reference window to create haplotypes (can be an issue at end of contigs)
if (ref.getWindow().getStop() <= loc.getStop()+HAPLOTYPE_SIZE)
return null;
if ( !(priors instanceof DiploidIndelGenotypePriors) )
throw new StingException("Only diploid-based Indel priors are supported in the DINDEL GL model");