From f994220617bec1bf8d91f71ffac3b64d7856ae54 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Mon, 29 Jun 2015 17:54:08 -0400 Subject: [PATCH] Update the allele remapping code to handle the new spanning deletion allele. Now that Ron updated the GATK so that we use star to represent spanning deletions, we need to catch those cases in the code that remaps alleles. Otherwise, we try to pad the stars and that's just bad. Added test from actual failing data. --- .../ReferenceConfidenceVariantContextMerger.java | 9 +++++++-- .../variantutils/GenotypeGVCFsIntegrationTest.java | 12 ++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/ReferenceConfidenceVariantContextMerger.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/ReferenceConfidenceVariantContextMerger.java index 2780c3806..1bce6000c 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/ReferenceConfidenceVariantContextMerger.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/variantutils/ReferenceConfidenceVariantContextMerger.java @@ -288,10 +288,15 @@ public class ReferenceConfidenceVariantContextMerger { for (final Allele a : vc.getAlternateAlleles()) { if (a.isSymbolic()) { result.add(a); - // we always skip when adding to finalAlleles; this is done outside if applies. - // we also skip <*DEL> if there isn't a real alternate allele. + // we always skip when adding to finalAlleles; this is done outside if it applies. + // we also skip <*:DEL> if there isn't a real alternate allele. if ( !a.equals(GATKVCFConstants.NON_REF_SYMBOLIC_ALLELE) && !vc.isSymbolic() ) finalAlleles.add(a); + } else if ( a == Allele.SPAN_DEL ) { + result.add(a); + // we skip * if there isn't a real alternate allele. + if ( !vc.isBiallelic() ) + finalAlleles.add(a); } else if (a.isCalled()) { final Allele newAllele; if (extraBaseCount > 0) { diff --git a/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFsIntegrationTest.java b/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFsIntegrationTest.java index 601183705..73f410786 100644 --- a/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFsIntegrationTest.java +++ b/protected/gatk-tools-protected/src/test/java/org/broadinstitute/gatk/tools/walkers/variantutils/GenotypeGVCFsIntegrationTest.java @@ -502,4 +502,16 @@ public class GenotypeGVCFsIntegrationTest extends WalkerTest { spec.disableShadowBCF(); executeTest("testSpanningDeletionDoesNotGetGenotypedWithNoOtherAlleles", spec); } + + @Test(enabled = true) + public void testGenotypingSpanningDeletionOverSpan() { + WalkerTestSpec spec = new WalkerTestSpec( + "-T GenotypeGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference + + " -V " + privateTestDir + "spanningDel.delOverSpan.1.g.vcf -V " + + privateTestDir + "spanningDel.delOverSpan.2.g.vcf", + 0, + Arrays.asList("")); // we do not care about the md5; we just want to make sure it doesn't blow up with an error + spec.disableShadowBCF(); + executeTest("testGenotypingSpanningDeletionOverSpan", spec); + } } \ No newline at end of file