From a2d6cef1812b038949eec7c91c07204d475d51ca Mon Sep 17 00:00:00 2001 From: delangel Date: Thu, 9 Dec 2010 19:34:23 +0000 Subject: [PATCH] Weird corner condition fix in indel genotyper: if there are 2 consecutive locations on candidate sites to genotype, we can get both when calling getVariantContexts and if we are triggering on an extended event - this leads to confusion and we can end up picking the wrong one. So, we require start of the vc to be the same as the start of the ref locus to be sure. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4812 348d0f76-0448-11de-a6fe-93d51630548a --- .../genotyper/DindelGenotypeLikelihoodsCalculationModel.java | 4 ++-- 1 file changed, 2 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 de18cbd34..e63b7c6ec 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DindelGenotypeLikelihoodsCalculationModel.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/DindelGenotypeLikelihoodsCalculationModel.java @@ -75,7 +75,7 @@ public class DindelGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoo VariantContext vc = null; for( final VariantContext vc_input : tracker.getVariantContexts(ref, "indels", null, ref.getLocus(), false, false) ) { - if( vc_input != null && vc_input.isIndel() ) { + if( vc_input != null && vc_input.isIndel() && ref.getLocus().getStart() == vc_input.getStart()) { vc = vc_input; break; } @@ -90,6 +90,7 @@ public class DindelGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoo boolean visitedBefore = false; synchronized (this) { + if (sitesVisited.contains(new Integer(vc.getStart())) && contextType.equals(StratifiedAlignmentContext.StratifiedContextType.COMPLETE)) visitedBefore = true; @@ -105,7 +106,6 @@ public class DindelGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoo if (vc.getStart() <= HAPLOTYPE_SIZE) return null; - if ( !(priors instanceof DiploidIndelGenotypePriors) ) throw new StingException("Only diploid-based Indel priors are supported in the DINDEL GL model");