Add fix and test for finalizing MQ annotation at BP resolution for variant and ref samples

Addresses issue #1356
This commit is contained in:
Laura Gauthier 2016-05-04 16:43:33 -04:00
parent ff532ed0cd
commit 644076b1e1
2 changed files with 22 additions and 5 deletions

View File

@ -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;

View File

@ -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(