From 00310c05bbb882ea5c1fb6879d1ec5d6d047e2ef Mon Sep 17 00:00:00 2001 From: delangel Date: Thu, 13 Jan 2011 21:08:22 +0000 Subject: [PATCH] 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 --- .../genotyper/DindelGenotypeLikelihoodsCalculationModel.java | 3 +++ 1 file changed, 3 insertions(+) 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 ba74f401a..bf23640e5 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DindelGenotypeLikelihoodsCalculationModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DindelGenotypeLikelihoodsCalculationModel.java @@ -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");