From 644076b1e13cfdd35465db267632857336c26fda Mon Sep 17 00:00:00 2001 From: Laura Gauthier Date: Wed, 4 May 2016 16:43:33 -0400 Subject: [PATCH] Add fix and test for finalizing MQ annotation at BP resolution for variant and ref samples Addresses issue #1356 --- .../tools/walkers/annotator/RMSAnnotation.java | 10 ++++++++-- .../GenotypeGVCFsIntegrationTest.java | 17 ++++++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/RMSAnnotation.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/RMSAnnotation.java index 7196e7ee6..f6307f3f7 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/RMSAnnotation.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/annotator/RMSAnnotation.java @@ -212,8 +212,14 @@ public abstract class RMSAnnotation extends InfoFieldAnnotation implements Reduc numOfReads += Integer.parseInt(vc.getAttributeAsString(VCFConstants.DEPTH_KEY, "-1")); if(vc.hasGenotypes()) { for(Genotype gt : vc.getGenotypes()) { - if(gt.isHomRef() && gt.hasExtendedAttribute("MIN_DP")) //site-level DP contribution will come from MIN_DP for gVCF-called reference variants - numOfReads -= Integer.parseInt(gt.getExtendedAttribute("MIN_DP").toString()); + if(gt.isHomRef()) { + //site-level DP contribution will come from MIN_DP for gVCF-called reference variants or DP for BP resolution + if (gt.hasExtendedAttribute("MIN_DP")) + numOfReads -= Integer.parseInt(gt.getExtendedAttribute("MIN_DP").toString()); + else if (gt.hasDP()) + numOfReads -= gt.getDP(); + } + } } return numOfReads; 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 59d146167..b93f5f4a9 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 @@ -109,7 +109,7 @@ public class GenotypeGVCFsIntegrationTest extends WalkerTest { " -V:sample3 " + privateTestDir + "combine.single.sample.pipeline.3.vcf" + " -L 20:10,000,000-11,000,000", b37KGReference), 1, - Arrays.asList("d3fab0d45f0054b71aa1d031876a4bbb")); + Arrays.asList("c9edd4ca8c2801c4681322087d82e781")); executeTest("combineSingleSamplePipelineGVCF", spec); } @@ -158,7 +158,7 @@ public class GenotypeGVCFsIntegrationTest extends WalkerTest { " -V:sample3 " + privateTestDir + "combine.single.sample.pipeline.3.vcf" + " -L 20:10,000,000-20,000,000", b37KGReference), 1, - Arrays.asList("54a86ade63b84c87ff4e537e276987fc")); + Arrays.asList("f48114bc6348cdc9dc4f0960f5dcf5f8")); executeTest("combineSingleSamplePipelineGVCFHierarchical", spec); } @@ -170,10 +170,21 @@ public class GenotypeGVCFsIntegrationTest extends WalkerTest { " -V:sample3 " + privateTestDir + "combine.single.sample.pipeline.3.vcf" + " -L 20:10,000,000-11,000,000 --dbsnp " + b37dbSNP132, b37KGReference), 1, - Arrays.asList("1a2728e7295a6ffca6c2ba5a01af3593")); + Arrays.asList("f88841deb5c2ce4f3bbea1e914a13898")); executeTest("combineSingleSamplePipelineGVCF_addDbsnp", spec); } + @Test(enabled = true) + public void combineBPresGVCFs() { + WalkerTestSpec spec = new WalkerTestSpec( + baseTestString(" -V " + privateTestDir + "NA12891.BPres.g.vcf" + + " -V " + privateTestDir + "NA12892.BPres.g.vcf" + + " -L 20:10433000-10436909", b37KGReference), + 1, + Arrays.asList("f342872f485e6978501facc78c354078")); + executeTest("combineBPresGVCFs", spec); + } + @Test(enabled = true) public void testJustOneSample() { WalkerTestSpec spec = new WalkerTestSpec(