From 231d3053eda2845feac7124261d37dc1e70aa595 Mon Sep 17 00:00:00 2001 From: ldgauthier Date: Thu, 21 Nov 2019 12:25:59 -0500 Subject: [PATCH] GatherTranches: fix required arg that had a default value, making it not required anymore (#6273) --- .../tools/walkers/vqsr/GatherTranches.java | 4 ++-- .../vqsr/GatherTranchesIntegrationTest.java | 20 +++++++++++++++++++ .../VQSR/expected/indels.gathered.tranches | 3 +++ .../resources/large/VQSR/indels.0.tranches | 3 +++ .../resources/large/VQSR/indels.1.tranches | 3 +++ 5 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/large/VQSR/expected/indels.gathered.tranches create mode 100644 src/test/resources/large/VQSR/indels.0.tranches create mode 100644 src/test/resources/large/VQSR/indels.1.tranches diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/GatherTranches.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/GatherTranches.java index c01d13493ba..b836bcd8940 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/GatherTranches.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/vqsr/GatherTranches.java @@ -43,8 +43,8 @@ public class GatherTranches extends CommandLineProgram { /** * Use either SNP for recalibrating only SNPs (emitting indels untouched in the output VCF) or INDEL for indels (emitting SNPs untouched in the output VCF). There is also a BOTH option for recalibrating both SNPs and indels simultaneously, but this is meant for testing purposes only and should not be used in actual analyses. */ - @Argument(fullName = "mode", shortName = "mode", doc = "Recalibration mode to employ", optional = false) - public VariantRecalibratorArgumentCollection.Mode MODE = VariantRecalibratorArgumentCollection.Mode.SNP; + @Argument(fullName = "mode", shortName = "mode", doc = "Recalibration mode to employ") + public VariantRecalibratorArgumentCollection.Mode MODE; @Argument(fullName = StandardArgumentDefinitions.OUTPUT_LONG_NAME, shortName = StandardArgumentDefinitions.OUTPUT_SHORT_NAME, doc="File to output the gathered tranches file to") diff --git a/src/test/java/org/broadinstitute/hellbender/tools/walkers/vqsr/GatherTranchesIntegrationTest.java b/src/test/java/org/broadinstitute/hellbender/tools/walkers/vqsr/GatherTranchesIntegrationTest.java index 2c503b2f9a5..10a322f0731 100644 --- a/src/test/java/org/broadinstitute/hellbender/tools/walkers/vqsr/GatherTranchesIntegrationTest.java +++ b/src/test/java/org/broadinstitute/hellbender/tools/walkers/vqsr/GatherTranchesIntegrationTest.java @@ -28,6 +28,7 @@ public void testCombine2Shards() throws Exception { args.add(recal1.getAbsolutePath()); args.add("--input"); args.add(recal2.getAbsolutePath()); + args.addArgument("mode", "SNP"); final File outFile = GATKBaseTest.createTempFile("gatheredTranches", ".txt"); args.addOutput(outFile); @@ -36,5 +37,24 @@ public void testCombine2Shards() throws Exception { IntegrationTestSpec.assertEqualTextFiles(outFile, recal_original); } + @Test + public void testCombine2IndelTranches() throws Exception { + final File tranches1 = new File(testDir + "indels.0.tranches"); + final File tranches2 = new File(testDir + "indels.1.tranches"); + + final File recal_original = new File(testDir + "expected/indels.gathered.tranches"); + + final ArgumentsBuilder args = new ArgumentsBuilder(); + args.add("--input"); + args.add(tranches1.getAbsolutePath()); + args.add("--input"); + args.add(tranches2.getAbsolutePath()); + args.addArgument("mode", "INDEL"); + final File outFile = GATKBaseTest.createTempFile("gatheredTranches", ".txt"); + args.addOutput(outFile); + final Object res = this.runCommandLine(args.getArgsArray()); + Assert.assertEquals(res, 0); + IntegrationTestSpec.assertEqualTextFiles(outFile, recal_original); + } } \ No newline at end of file diff --git a/src/test/resources/large/VQSR/expected/indels.gathered.tranches b/src/test/resources/large/VQSR/expected/indels.gathered.tranches new file mode 100644 index 00000000000..e6a038ea28e --- /dev/null +++ b/src/test/resources/large/VQSR/expected/indels.gathered.tranches @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1c011564551ef6d323a56c6ef45758a818c408616a1ba18daad2e864166efe4 +size 476 diff --git a/src/test/resources/large/VQSR/indels.0.tranches b/src/test/resources/large/VQSR/indels.0.tranches new file mode 100644 index 00000000000..50f4439c74f --- /dev/null +++ b/src/test/resources/large/VQSR/indels.0.tranches @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15711d2da31952cd0207a935d0e1f80f5445cf2bf76f9e55fec4719ca575633f +size 99338 diff --git a/src/test/resources/large/VQSR/indels.1.tranches b/src/test/resources/large/VQSR/indels.1.tranches new file mode 100644 index 00000000000..49723e790a9 --- /dev/null +++ b/src/test/resources/large/VQSR/indels.1.tranches @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99ecdf1ff97e926e295b8af9da2a22b9fa436d1a1fdbcd20dd41fe40399228f9 +size 99252