From cb1e8ad43a98512ce6aac280e6cda90d2edf9b1c Mon Sep 17 00:00:00 2001 From: delangel Date: Sun, 14 Nov 2010 00:21:54 +0000 Subject: [PATCH] Temp bug fix for indel genotyper: if there are two or more variant contexts at a site, just choose the first one containing an indel and genotype that. There might be cases where IGv2 emits 2 indel variant contexts in at the same ref location which made us fail there. A better solution will be to form underlying haplotypes supported by reads and compute likelihoods of that. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4667 348d0f76-0448-11de-a6fe-93d51630548a --- .../DindelGenotypeLikelihoodsCalculationModel.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/DindelGenotypeLikelihoodsCalculationModel.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/DindelGenotypeLikelihoodsCalculationModel.java index b1d3e8a12..dbaf3beab 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/DindelGenotypeLikelihoodsCalculationModel.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/genotyper/DindelGenotypeLikelihoodsCalculationModel.java @@ -74,8 +74,14 @@ public class DindelGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoo if ( tracker == null ) return null; + VariantContext vc = null; - VariantContext vc = tracker.getVariantContext(ref, "indels", null, ref.getLocus(), true); + for( final VariantContext vc_input : tracker.getVariantContexts(ref, "indels", null, ref.getLocus(), false, false) ) { + if( vc_input != null && vc_input.isIndel() ) { + vc = vc_input; + break; + } + } // ignore places where we don't have a variant if ( vc == null ) return null; @@ -143,6 +149,7 @@ public class DindelGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoo GLs.put(sample.getKey(), new BiallelicGenotypeLikelihoods(sample.getKey(),vc.getReference(), vc.getAlternateAllele(0), genotypeLikelihoods[0],genotypeLikelihoods[1], genotypeLikelihoods[2])); + //System.out.format("%4.2f %4.2f %4.2f\n",genotypeLikelihoods[0],genotypeLikelihoods[1], genotypeLikelihoods[2]); } }