Search in sources :

Example 61 with ArgumentsBuilder

use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.

the class ExampleCollectSingleMetricsIntegrationTest method test.

@Test(dataProvider = "metricsInputFiles", groups = "spark")
public void test(final String fileName, final String expectedResultsFile) throws IOException {
    final File input = new File(TEST_DATA_DIR, fileName);
    final File textOut = BaseTest.createTempFile("test", ".txt");
    final ArgumentsBuilder args = new ArgumentsBuilder();
    // IO arguments
    args.addInput(input);
    args.addOutput(textOut);
    this.runCommandLine(args);
    IntegrationTestSpec.assertEqualTextFiles(textOut, new File(TEST_DATA_DIR, expectedResultsFile), "#");
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) File(java.io.File) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 62 with ArgumentsBuilder

use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.

the class ExampleIntervalWalkerSparkIntegrationTest method testExampleIntervalWalker.

@Test
public void testExampleIntervalWalker() throws IOException {
    final File out = File.createTempFile("out", ".txt");
    out.delete();
    out.deleteOnExit();
    final ArgumentsBuilder args = new ArgumentsBuilder();
    args.add("-L 1:100-200 -L 2:500-600");
    args.add("--input");
    args.add(TEST_DATA_DIRECTORY + "reads_data_source_test1.bam");
    args.add("-V");
    args.add(TEST_DATA_DIRECTORY + "feature_data_source_test.vcf");
    args.add("--output");
    args.add(out.getAbsolutePath());
    args.add("--reference");
    args.add(hg19MiniReference);
    this.runCommandLine(args.getArgsArray());
    File expected = new File(TEST_OUTPUT_DIRECTORY, "expected_ExampleIntervalWalkerIntegrationTest_output.txt");
    IntegrationTestSpec.assertEqualTextFiles(new File(out, "part-00000"), expected);
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) File(java.io.File) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 63 with ArgumentsBuilder

use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.

the class ExampleAssemblyRegionWalkerSparkIntegrationTest method testExampleAssemblyRegionWalker.

// DISABLED until https://github.com/broadinstitute/gatk/issues/2349 is resolved
@Test(enabled = false)
public void testExampleAssemblyRegionWalker() throws Exception {
    final File out = File.createTempFile("out", ".txt");
    out.delete();
    out.deleteOnExit();
    final ArgumentsBuilder args = new ArgumentsBuilder();
    args.add("--input");
    args.add(NA12878_20_21_WGS_bam);
    args.add("--output");
    args.add(out.getAbsolutePath());
    args.add("--reference");
    args.add(b37_reference_20_21);
    args.add("-knownVariants " + dbsnp_138_b37_20_21_vcf);
    args.add("-L 20:10000000-10050000");
    this.runCommandLine(args.getArgsArray());
    File expected = new File(TEST_OUTPUT_DIRECTORY, "expected_ExampleAssemblyRegionWalkerIntegrationTest_output.txt");
    IntegrationTestSpec.assertEqualTextFiles(new File(out, "part-00000"), expected);
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) File(java.io.File) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 64 with ArgumentsBuilder

use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.

the class StructuralVariationDiscoveryPipelineSparkIntegrationTest method testSVDiscoverPipelineRunnableLocal.

@Test(dataProvider = "svDiscoverPipelineSparkIntegrationTest", groups = "sv")
public void testSVDiscoverPipelineRunnableLocal(final StructuralVariationDiscoveryPipelineSparkIntegrationTest.StructuralVariationDiscoveryPipelineSparkIntegrationTestArgs params) throws Exception {
    final List<String> args = Arrays.asList(new ArgumentsBuilder().add(params.getCommandLineNoApiKey()).getArgsArray());
    runCommandLine(args);
    svDiscoveryVCFEquivalenceTest(args.get(args.indexOf("-O") + 1), SVIntegrationTestDataProvider.EXPECTED_SIMPLE_DEL_VCF, Arrays.asList("ALIGN_LENGTHS", "CTG_NAMES"), false);
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 65 with ArgumentsBuilder

use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.

the class GenotypeGVCFsIntegrationTest method testIndexIsCreated.

@Test
public void testIndexIsCreated() {
    final File output = createTempFile("test", ".vcf");
    final File index = new File(output.getAbsolutePath() + Tribble.STANDARD_INDEX_EXTENSION);
    Assert.assertFalse(index.exists());
    final ArgumentsBuilder args = new ArgumentsBuilder().addVCF(getTestFile(BASE_PAIR_GVCF)).addOutput(output).addReference(new File(b37_reference_20_21)).addArgument(StandardArgumentDefinitions.CREATE_OUTPUT_VARIANT_INDEX_LONG_NAME, "true");
    runCommandLine(args);
    Assert.assertTrue(index.exists());
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) File(java.io.File) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Aggregations

ArgumentsBuilder (org.broadinstitute.hellbender.utils.test.ArgumentsBuilder)139 Test (org.testng.annotations.Test)127 CommandLineProgramTest (org.broadinstitute.hellbender.CommandLineProgramTest)123 File (java.io.File)104 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)62 IntegrationTestSpec (org.broadinstitute.hellbender.utils.test.IntegrationTestSpec)14 MetricsFile (htsjdk.samtools.metrics.MetricsFile)10 Path (org.apache.hadoop.fs.Path)5 VariantContext (htsjdk.variant.variantcontext.VariantContext)4 AbstractMarkDuplicatesCommandLineProgramTest (org.broadinstitute.hellbender.utils.test.testers.AbstractMarkDuplicatesCommandLineProgramTest)4 FileReader (java.io.FileReader)3 Configuration (org.apache.hadoop.conf.Configuration)3 Main (org.broadinstitute.hellbender.Main)3 CommandLineProgram (org.broadinstitute.hellbender.cmdline.CommandLineProgram)3 SAMRecord (htsjdk.samtools.SAMRecord)2 SamReader (htsjdk.samtools.SamReader)2 SamReaderFactory (htsjdk.samtools.SamReaderFactory)2 List (java.util.List)2 org.apache.hadoop.fs (org.apache.hadoop.fs)2 MiniDFSCluster (org.apache.hadoop.hdfs.MiniDFSCluster)2