In ApplyRecalibration marking filter as PASS instead of '.' when the site passes by calling .passFilters().

This commit is contained in:
Khalid Shakir 2012-07-13 15:40:56 -04:00
parent 279dff9f81
commit 6dfcc486e8
2 changed files with 20 additions and 6 deletions

View File

@ -172,7 +172,7 @@ public class ApplyRecalibration extends RodWalker<Integer, Integer> implements T
vcfWriter.writeHeader(vcfHeader); vcfWriter.writeHeader(vcfHeader);
} }
public static final void addVQSRStandardHeaderLines(final Set<VCFHeaderLine> hInfo) { public static void addVQSRStandardHeaderLines(final Set<VCFHeaderLine> hInfo) {
hInfo.add(VCFStandardHeaderLines.getInfoLine(VCFConstants.END_KEY)); hInfo.add(VCFStandardHeaderLines.getInfoLine(VCFConstants.END_KEY));
hInfo.add(new VCFInfoHeaderLine(VariantRecalibrator.VQS_LOD_KEY, 1, VCFHeaderLineType.Float, "Log odds ratio of being a true variant versus being false under the trained gaussian mixture model")); hInfo.add(new VCFInfoHeaderLine(VariantRecalibrator.VQS_LOD_KEY, 1, VCFHeaderLineType.Float, "Log odds ratio of being a true variant versus being false under the trained gaussian mixture model"));
hInfo.add(new VCFInfoHeaderLine(VariantRecalibrator.CULPRIT_KEY, 1, VCFHeaderLineType.String, "The annotation which was the worst performing in the Gaussian mixture model, likely the reason why the variant was filtered out")); hInfo.add(new VCFInfoHeaderLine(VariantRecalibrator.CULPRIT_KEY, 1, VCFHeaderLineType.String, "The annotation which was the worst performing in the Gaussian mixture model, likely the reason why the variant was filtered out"));
@ -236,7 +236,9 @@ public class ApplyRecalibration extends RodWalker<Integer, Integer> implements T
filterString = tranches.get(0).name+"+"; filterString = tranches.get(0).name+"+";
} }
if( !filterString.equals(VCFConstants.PASSES_FILTERS_v4) ) { if( filterString.equals(VCFConstants.PASSES_FILTERS_v4) ) {
builder.passFilters();
} else {
builder.filters(filterString); builder.filters(filterString);
} }

View File

@ -18,6 +18,11 @@ public class VariantRecalibrationWalkersIntegrationTest extends WalkerTest {
this.recalMD5 = recalMD5; this.recalMD5 = recalMD5;
this.cutVCFMD5 = cutVCFMD5; this.cutVCFMD5 = cutVCFMD5;
} }
@Override
public String toString() {
return "VRTest{inVCF='" + inVCF +"'}";
}
} }
VRTest lowPass = new VRTest("phase1.projectConsensus.chr20.raw.snps.vcf", VRTest lowPass = new VRTest("phase1.projectConsensus.chr20.raw.snps.vcf",
@ -69,14 +74,21 @@ public class VariantRecalibrationWalkersIntegrationTest extends WalkerTest {
executeTest("testApplyRecalibration-"+params.inVCF, spec); executeTest("testApplyRecalibration-"+params.inVCF, spec);
} }
VRTest indel = new VRTest("combined.phase1.chr20.raw.indels.sites.vcf", VRTest indelUnfiltered = new VRTest(
"combined.phase1.chr20.raw.indels.unfiltered.sites.vcf", // all FILTERs as .
"b7589cd098dc153ec64c02dcff2838e4", // tranches "b7589cd098dc153ec64c02dcff2838e4", // tranches
"a04a9001f62eff43d363f4d63769f3ee", // recal file "a04a9001f62eff43d363f4d63769f3ee", // recal file
"888eb042dd33b807bcbb8630896fda94"); // cut VCF "64f576881e21323dd4078262604717a2"); // cut VCF
VRTest indelFiltered = new VRTest(
"combined.phase1.chr20.raw.indels.filtered.sites.vcf", // all FILTERs as PASS
"b7589cd098dc153ec64c02dcff2838e4", // tranches
"a04a9001f62eff43d363f4d63769f3ee", // recal file
"af22c55d91394c56a222fd40d6d54781"); // cut VCF
@DataProvider(name = "VRIndelTest") @DataProvider(name = "VRIndelTest")
public Object[][] createData2() { public Object[][] createTestVariantRecalibratorIndel() {
return new Object[][]{ {indel} }; return new Object[][]{ {indelUnfiltered}, {indelFiltered} };
} }
@Test(dataProvider = "VRIndelTest") @Test(dataProvider = "VRIndelTest")