use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class AddOrReplaceReadGroupsIntegrationTest method runIt.
private void runIt(final File inputFile, final File referenceFile, final File outputFile) {
final ArgumentsBuilder args = new ArgumentsBuilder();
args.add("--input");
args.add(inputFile.getAbsolutePath());
args.add("--output");
args.add(outputFile.getAbsolutePath());
if (null != referenceFile) {
args.add("--R");
args.add(referenceFile.getAbsolutePath());
}
args.add("--LB");
args.add("foo_LB");
args.add("--PL");
args.add("foo_PL");
args.add("--PU");
args.add("foo_PU");
args.add("--SM");
args.add("foo_SM");
args.add("--CN");
args.add("foo_CN");
args.add("--DS");
args.add("foo_DS");
args.add("--DT");
args.add("2015-08-21T09:40:00");
args.add("--PI");
args.add("157");
args.add("--PG");
args.add("foo_PG");
args.add("--PM");
args.add("foo_PM");
runCommandLine(args.getArgsList());
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class GatherBQSRReportsIntegrationTest method testCombineReportsFromTwoChrs.
@Test
public void testCombineReportsFromTwoChrs() throws Exception {
//NOte: this data was generated by running GATK BaseRecalibrator like this
// ./gatk-launch BaseRecalibrator -I src/test/resources/large/CEUTrio.HiSeq.WGS.b37.NA12878.20.21.bam -O gatk4_chr20.tbl --knownSites src/test/resources/large/dbsnp_138.b37.20.21.vcf -R src/test/resources/large/human_g1k_v37.20.21.fasta -L 20
// ./gatk-launch BaseRecalibrator -I src/test/resources/large/CEUTrio.HiSeq.WGS.b37.NA12878.20.21.bam -O gatk4_chr21.tbl --knownSites src/test/resources/large/dbsnp_138.b37.20.21.vcf -R src/test/resources/large/human_g1k_v37.20.21.fasta -L 21
// ./gatk-launch GatherBQSRReports -I gatk4_chr20.tbl -I gatk4_chr21.tbl -O gatk4_combined.tbl
// Then, the results were manually compared to those generated by GATK3.4 and confirmed to be the same up to 0.01 (which is OK)
final File chr20 = new File(testDir + "gatk4_chr20.tbl.gz");
final File chr21 = new File(testDir + "gatk4_chr21.tbl.gz");
final File chr2021_combined = new File(testDir + "gatk4_combined.tbl.gz");
final ArgumentsBuilder args = new ArgumentsBuilder();
args.add("--input");
args.add(chr20.getAbsolutePath());
args.add("--input");
args.add(chr21.getAbsolutePath());
final File outFile = BaseTest.createTempFile("bqsr2021.", "table");
args.add("-O");
args.add(outFile.getAbsolutePath());
final Object res = this.runCommandLine(args.getArgsArray());
Assert.assertEquals(res, 0);
IntegrationTestSpec.assertEqualTextFiles(outFile, chr2021_combined);
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class BothStepsOfBQSRIntegrationTest method testIndelRemoval.
//Tests that BQSR with and without indel recalibration produces the same bam file
@Test
public void testIndelRemoval() throws Exception {
//Note; using a small 27M file for speed
final File bamIn = new File(NA12878_20_21_WGS_bam);
final String interval = "20";
final File recalOutWithIndels = baseRecalibrator(bamIn, interval, false);
final File bamOutWithIndels = applyBQSR(bamIn, interval, recalOutWithIndels, false);
final File recalOutWithoutIndels = baseRecalibrator(bamIn, interval, true);
final File bamOutWithoutIndels = applyBQSR(bamIn, interval, recalOutWithoutIndels, true);
final ArgumentsBuilder args1 = new ArgumentsBuilder();
args1.addArgument("VALIDATION_STRINGENCY", ValidationStringency.SILENT.name());
args1.addPositionalArgument(bamOutWithIndels.getAbsolutePath());
args1.addPositionalArgument(bamOutWithoutIndels.getAbsolutePath());
final Object result = new Main().instanceMain(makeCommandLineArgs(args1.getArgsList(), CompareBaseQualities.class.getSimpleName()));
Assert.assertEquals(result, 0);
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class BothStepsOfBQSRIntegrationTest method applyBQSR.
private File applyBQSR(final File bamIn, final String interval, final File recalOut, final boolean skipIndels) {
final File bamOut = BaseTest.createTempFile("applyBQSR." + skipIndels, ".bam");
final ArgumentsBuilder args1 = new ArgumentsBuilder();
args1.addInput(bamIn);
args1.addFileArgument("bqsr", recalOut);
args1.addArgument("L", interval);
args1.addOutput(bamOut);
new Main().instanceMain(makeCommandLineArgs(args1.getArgsList(), ApplyBQSR.class.getSimpleName()));
return bamOut;
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class BothStepsOfBQSRIntegrationTest method baseRecalibrator.
private File baseRecalibrator(final File bamIn, final String interval, final boolean skipIndels) {
final File recalOut = BaseTest.createTempFile("baseRecalibrator." + skipIndels, ".recal");
final ArgumentsBuilder args1 = new ArgumentsBuilder();
args1.addInput(bamIn);
args1.addOutput(recalOut);
args1.addArgument("L", interval);
args1.addFileArgument("knownSites", new File(dbsnp_138_b37_20_21_vcf));
args1.addReference(new File(b37_reference_20_21));
args1.addBooleanArgument("indelBQSR", !skipIndels);
new Main().instanceMain(makeCommandLineArgs(args1.getArgsList(), BaseRecalibrator.class.getSimpleName()));
return recalOut;
}
Aggregations