use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CountBasesIntegrationTest method testCountBases.
@Test(dataProvider = "filenames")
public void testCountBases(final String fileIn, final String referenceName) throws Exception {
final File ORIG_BAM = new File(getTestDataDir(), fileIn);
final ArgumentsBuilder args = new ArgumentsBuilder();
args.add("--input");
args.add(ORIG_BAM.getAbsolutePath());
if (null != referenceName) {
final File REF = new File(getTestDataDir(), referenceName);
args.add("-R");
args.add(REF.getAbsolutePath());
}
final Object res = this.runCommandLine(args.getArgsArray());
Assert.assertEquals(res, 808l);
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CountReadsIntegrationTest method testNoArgs.
@Test(expectedExceptions = CommandLineException.class)
public void testNoArgs() throws Exception {
//making sure that this blows up in a very specific way (UserException.CommandLineException) if we give bogus arguments
final ArgumentsBuilder args = new ArgumentsBuilder();
this.runCommandLine(args.getArgsArray());
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CountVariantsIntegrationTest method testCountVariants.
@Test(dataProvider = "countVariantsVCFInputs")
public void testCountVariants(final File fileIn, final String moreArgs, final long expectedCount) throws Exception {
final ArgumentsBuilder ab = new ArgumentsBuilder();
ab.addVCF(fileIn);
ab.add(moreArgs);
final Object res = runCommandLine(ab.getArgsArray());
Assert.assertEquals(res, expectedCount);
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class PrintReadsIntegrationTest method testUnmappedReadInclusion.
@Test(dataProvider = "UnmappedReadInclusionTestData")
public void testUnmappedReadInclusion(final File input, final String reference, final List<String> intervalStrings, final List<String> expectedReadNames) {
final File outFile = createTempFile("testUnmappedReadInclusion", ".bam");
final ArgumentsBuilder args = new ArgumentsBuilder();
args.add("-I");
args.add(input.getAbsolutePath());
args.add("-O");
args.add(outFile.getAbsolutePath());
for (final String intervalString : intervalStrings) {
args.add("-L");
args.add(intervalString);
}
if (reference != null) {
args.add("-R");
args.add(reference);
}
runCommandLine(args);
try (final ReadsDataSource outputReadsSource = new ReadsDataSource(outFile.toPath())) {
final List<GATKRead> actualReads = new ArrayList<>();
for (final GATKRead read : outputReadsSource) {
actualReads.add(read);
}
Assert.assertEquals(actualReads.size(), expectedReadNames.size(), "Wrong number of reads output");
for (int readNumber = 0; readNumber < actualReads.size(); ++readNumber) {
Assert.assertEquals(actualReads.get(readNumber).getName(), expectedReadNames.get(readNumber), "Unexpected read name");
}
}
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CollectBaseDistributionByCycleIntegrationTest method test.
@Test(dataProvider = "CollectBaseDistributionByCycle", 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);
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, "#");
}
Aggregations