From 487fb2afb43693f6cb3c5fa52d5c98eff7451ddf Mon Sep 17 00:00:00 2001 From: Ryan Poplin Date: Wed, 9 Jan 2013 15:30:46 -0500 Subject: [PATCH] Bug fix for the case of overlapping assembled and partially-assembled events created by the HC. Unfortunately the symbolic allele can't be combined with the indel allele because the reference basis will change. --- .../sting/gatk/walkers/haplotypecaller/GenotypingEngine.java | 4 ++-- .../variant/variantcontext/VariantContextUtils.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java index 7c25ab551..42f5e1455 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/haplotypecaller/GenotypingEngine.java @@ -92,6 +92,7 @@ public class GenotypingEngine { cleanUpSymbolicUnassembledEvents( haplotypes ); if( !in_GGA_mode && samples.size() >= 10 ) { // if not in GGA mode and have at least 10 samples try to create MNP and complex events by looking at LD structure mergeConsecutiveEventsBasedOnLD( haplotypes, samples, haplotypeReadMap, startPosKeySet, ref, refLoc ); + cleanUpSymbolicUnassembledEvents( haplotypes ); // the newly created merged events could be overlapping the unassembled events } if( in_GGA_mode ) { for( final VariantContext compVC : activeAllelesToGenotype ) { @@ -261,7 +262,6 @@ public class GenotypingEngine { return returnMap; } - protected static void cleanUpSymbolicUnassembledEvents( final List haplotypes ) { final ArrayList haplotypesToRemove = new ArrayList(); for( final Haplotype h : haplotypes ) { @@ -269,7 +269,7 @@ public class GenotypingEngine { if( vc.isSymbolic() ) { for( final Haplotype h2 : haplotypes ) { for( final VariantContext vc2 : h2.getEventMap().values() ) { - if( vc.getStart() == vc2.getStart() && vc2.isIndel() ) { + if( vc.getStart() == vc2.getStart() && (vc2.isIndel() || vc2.isMNP()) ) { // unfortunately symbolic alleles can't currently be combined with non-point events haplotypesToRemove.add(h); break; } diff --git a/public/java/src/org/broadinstitute/variant/variantcontext/VariantContextUtils.java b/public/java/src/org/broadinstitute/variant/variantcontext/VariantContextUtils.java index 4d1e70340..2d74a1a4a 100755 --- a/public/java/src/org/broadinstitute/variant/variantcontext/VariantContextUtils.java +++ b/public/java/src/org/broadinstitute/variant/variantcontext/VariantContextUtils.java @@ -710,7 +710,7 @@ public class VariantContextUtils { for ( VariantContext vc : VCs ) { // look at previous variant contexts of different type. If: - // a) otherVC has alleles which are subset of vc, remove otherVC from its list and add otherVC to vc's list + // a) otherVC has alleles which are subset of vc, remove otherVC from its list and add otherVC to vc's list // b) vc has alleles which are subset of otherVC. Then, add vc to otherVC's type list (rather, do nothing since vc will be added automatically to its list) // c) neither: do nothing, just add vc to its own list boolean addtoOwnList = true;