Skip to content

Commit

Permalink
GatherTranches: fix required arg that had a default value, making it …
Browse files Browse the repository at this point in the history
…not required anymore (#6273)
  • Loading branch information
ldgauthier authored and droazen committed Nov 21, 2019
1 parent cfb5217 commit 231d305
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}
Git LFS file not shown
3 changes: 3 additions & 0 deletions src/test/resources/large/VQSR/indels.0.tranches
Git LFS file not shown
3 changes: 3 additions & 0 deletions src/test/resources/large/VQSR/indels.1.tranches
Git LFS file not shown

0 comments on commit 231d305

Please sign in to comment.