use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CountReadsSparkIntegrationTest method test.
@Test(groups = "spark")
public void test() throws Exception {
final File unsortedBam = new File(getTestDataDir(), "count_reads.bam");
final File outputTxt = createTempFile("count_reads", ".txt");
ArgumentsBuilder args = new ArgumentsBuilder();
args.addInput(unsortedBam);
args.addOutput(outputTxt);
this.runCommandLine(args.getArgsArray());
final String readIn = FileUtils.readFileToString(outputTxt.getAbsoluteFile());
Assert.assertEquals((int) Integer.valueOf(readIn), 8);
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CountVariantsSparkIntegrationTest method test.
@Test(dataProvider = "filenames", groups = "spark")
public void test(final File fileIn, final long expected) throws Exception {
final File outputTxt = createTempFile("count_variants", ".txt");
ArgumentsBuilder args = new ArgumentsBuilder();
args.addVCF(fileIn);
args.addOutput(outputTxt);
this.runCommandLine(args.getArgsArray());
final String readIn = FileUtils.readFileToString(outputTxt.getAbsoluteFile());
Assert.assertEquals((int) Integer.valueOf(readIn), expected);
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CountVariantsSparkIntegrationTest method testNoNPRWhenOutputIsUnspecified.
@Test(groups = "spark")
public void testNoNPRWhenOutputIsUnspecified() {
ArgumentsBuilder args = new ArgumentsBuilder();
args.addVCF(COUNT_VARIANTS_VCF);
this.runCommandLine(args.getArgsArray());
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CountVariantsSparkIntegrationTest method testCountVariantsWithIntervals.
@Test(dataProvider = "intervals", groups = "spark")
public void testCountVariantsWithIntervals(final File fileIn, final String intervalArgs, final long expected) throws Exception {
final File outputTxt = createTempFile("count_variants", ".txt");
ArgumentsBuilder args = new ArgumentsBuilder();
args.addVCF(fileIn);
args.add(intervalArgs);
args.addReference(new File(largeFileTestDir, "human_g1k_v37.20.21.fasta"));
args.addOutput(outputTxt);
this.runCommandLine(args.getArgsArray());
final ByteArrayOutputStream baosErr = new ByteArrayOutputStream();
final PrintStream err = System.err;
try {
System.setErr(new PrintStream(baosErr));
this.runCommandLine(args.getArgsArray());
final String readIn = FileUtils.readFileToString(outputTxt.getAbsoluteFile());
Assert.assertEquals((int) Integer.valueOf(readIn), expected);
String errString = baosErr.toString();
Assert.assertFalse(errString.contains("Warning: using GzipCodec, which is not splittable,"), errString);
} finally {
//put this back in
System.setErr(err);
}
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class FlagStatSparkIntegrationTest method flagStatSparkLocalWithSmallInterval.
@Test(groups = "spark")
public void flagStatSparkLocalWithSmallInterval() throws IOException {
ArgumentsBuilder args = new ArgumentsBuilder();
args.addInput(getTestFile("flag_stat.bam"));
args.add("-L chr7:1-100 -XL chr7:2-100");
File outputFile = createTempFile("flagStatTest.chr1_1", ".txt");
args.addOutput(outputFile);
this.runCommandLine(args.getArgsArray());
Assert.assertTrue(outputFile.exists());
//the expected output was created using stand-alone hellbender
IntegrationTestSpec.assertMatchingFiles(Lists.newArrayList(outputFile), Lists.newArrayList(getToolTestDataDir() + "/" + "expectedStats.chr1_1.txt"), false, null);
}
Aggregations