use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class MeanQualityByCycleIntegrationTest method test.
@Test(dataProvider = "filenames", groups = { "R" })
public void test(final String inputFile, final String referenceName) throws IOException {
final File input = new File(TEST_DATA_DIR, inputFile);
final File expectedFile = new File(TEST_DATA_DIR, "meanqualbycycle.txt");
final File outfile = BaseTest.createTempFile("testMeanQualityByCycle", ".metrics");
final File pdf = BaseTest.createTempFile("testMeanQualityByCycle", ".pdf");
outfile.deleteOnExit();
pdf.deleteOnExit();
final ArgumentsBuilder args = new ArgumentsBuilder();
args.add("--input");
args.add(input.getAbsolutePath());
args.add("--output");
args.add(outfile.getAbsolutePath());
args.add("--CHART");
args.add(pdf.getAbsolutePath());
args.add("--PRODUCE_PLOT");
args.add("true");
if (null != referenceName) {
final File REF = new File(referenceName);
args.add("-R");
args.add(REF.getAbsolutePath());
}
runCommandLine(args.getArgsArray());
try (final FileReader actualReader = new FileReader(outfile)) {
final MetricsFile<?, Integer> output = new MetricsFile<>();
output.read(actualReader);
Assert.assertEquals(output.getAllHistograms().size(), 1);
Assert.assertEquals(output.getHistogram().size(), 202);
}
Assert.assertTrue(pdf.exists(), "exists");
Assert.assertTrue(pdf.length() > 0, "length");
IntegrationTestSpec.assertEqualTextFiles(outfile, expectedFile, "#");
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class QualityScoreDistributionIntegrationTest method test.
@Test(dataProvider = "QualityScoreDistribution", groups = { "R" })
public void test(final String unsortedBamName, final String expectedFileName, final String referenceName, final boolean makePdf, final boolean pfReadsOnly, final boolean alignedReadsOnly) throws IOException {
final File unsortedBam = new File(TEST_DATA_DIR, unsortedBamName);
final File expectedFile = new File(TEST_DATA_DIR, expectedFileName);
//Note we compare to non-spark outputs
final File outfile = BaseTest.createTempFile("test", ".metrics");
final File pdf = BaseTest.createTempFile("test", ".pdf");
ArgumentsBuilder args = new ArgumentsBuilder();
args.add("--" + "input");
args.add(unsortedBam.getCanonicalPath());
args.add("--" + "output");
args.add(outfile.getCanonicalPath());
if (null != referenceName) {
final File REF = new File(referenceName);
args.add("-R");
args.add(REF.getAbsolutePath());
}
args.add("--" + "CHART_OUTPUT");
args.add(pdf.getCanonicalPath());
args.add("--" + "PRODUCE_PLOT");
args.add(makePdf);
args.add("--" + "PF_READS_ONLY");
args.add(pfReadsOnly);
args.add("--" + "ALIGNED_READS_ONLY");
args.add(alignedReadsOnly);
this.runCommandLine(args.getArgsArray());
IntegrationTestSpec.assertEqualTextFiles(outfile, expectedFile, "#");
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class BQSRPipelineSparkIntegrationTest method testBlowUpOnBroadcastIncompatibleReference.
@Test(groups = "spark")
public void testBlowUpOnBroadcastIncompatibleReference() throws IOException {
//this should blow up because broadcast requires a 2bit reference
final String hiSeqBam_chr20 = getResourceDir() + WGS_B37_CH20_1M_1M1K_BAM;
final String dbSNPb37_chr20 = getResourceDir() + DBSNP_138_B37_CH20_1M_1M1K_VCF;
BQSRTest params = new BQSRTest(b37_reference_20_21, hiSeqBam_chr20, dbSNPb37_chr20, ".bam", "-indelBQSR -enableBAQ " + "--joinStrategy BROADCAST", getResourceDir() + BQSRTestData.EXPECTED_WGS_B37_CH20_1M_1M1K_RECAL);
ArgumentsBuilder ab = new ArgumentsBuilder().add(params.getCommandLineNoApiKey());
IntegrationTestSpec spec = new IntegrationTestSpec(ab.getString(), 1, UserException.Require2BitReferenceForBroadcast.class);
spec.executeTest("testBQSR-" + params.args, this);
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CountBasesSparkIntegrationTest method testNoNPRWhenOutputIsUnspecified.
@Test(groups = "spark")
public void testNoNPRWhenOutputIsUnspecified() {
ArgumentsBuilder args = new ArgumentsBuilder();
args.addInput(new File(getTestDataDir(), "count_bases.bam"));
this.runCommandLine(args.getArgsArray());
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CountReadsSparkIntegrationTest method testCountReadsWithIntervals.
@Test(dataProvider = "intervals", groups = "spark")
public void testCountReadsWithIntervals(final String interval_args, final long expectedCount) throws Exception {
final File ORIG_BAM = new File(getTestDataDir(), "count_reads_sorted.bam");
final File outputFile = createTempFile("count_reads_spark", "count");
ArgumentsBuilder args = new ArgumentsBuilder();
args.addInput(ORIG_BAM);
args.add(interval_args);
args.addOutput(outputFile);
this.runCommandLine(args.getArgsArray());
try (XReadLines output = new XReadLines(outputFile)) {
Assert.assertEquals((long) Long.valueOf(output.next()), expectedCount);
}
}
Aggregations