Search in sources :

Example 86 with IntegrationTestSpec

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

the class FeatureSupportIntegrationTest method testFeaturesAsIntervalsUnrecognizedFormatFile.

@Test
public void testFeaturesAsIntervalsUnrecognizedFormatFile() throws IOException {
    IntegrationTestSpec testSpec = new IntegrationTestSpec(" -R " + hg19MiniReference + " -I " + FEATURE_INTEGRATION_TEST_DIRECTORY + "reads_data_source_test1.bam" + " -L " + publicTestDir + "org/broadinstitute/hellbender/utils/interval/unrecognized_format_file.xyz" + " -O %s", 1, UserException.CouldNotReadInputFile.class);
    testSpec.executeTest("testFeaturesAsIntervals", this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) UserException(org.broadinstitute.hellbender.exceptions.UserException) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 87 with IntegrationTestSpec

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

the class FeatureSupportIntegrationTest method testFeaturesAsIntervalsWithExclusion.

@Test
public void testFeaturesAsIntervalsWithExclusion() throws IOException {
    IntegrationTestSpec testSpec = new IntegrationTestSpec(" -R " + hg19MiniReference + " -I " + FEATURE_INTEGRATION_TEST_DIRECTORY + "reads_data_source_test1.bam" + " -L " + publicTestDir + "org/broadinstitute/hellbender/utils/interval/intervals_from_features_test.vcf" + " -XL " + publicTestDir + "org/broadinstitute/hellbender/utils/interval/intervals_from_features_test_exclude.vcf" + " -O %s", Arrays.asList(FEATURE_INTEGRATION_TEST_DIRECTORY + "expected_testFeaturesAsIntervalsWithExclusion_output.txt"));
    testSpec.executeTest("testFeaturesAsIntervals", this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 88 with IntegrationTestSpec

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

the class FeatureSupportIntegrationTest method testFeaturesAsIntervals.

@Test
public void testFeaturesAsIntervals() throws IOException {
    IntegrationTestSpec testSpec = new IntegrationTestSpec(" -R " + hg19MiniReference + " -I " + FEATURE_INTEGRATION_TEST_DIRECTORY + "reads_data_source_test1.bam" + " -L " + publicTestDir + "org/broadinstitute/hellbender/utils/interval/intervals_from_features_test.vcf" + " -O %s", Arrays.asList(FEATURE_INTEGRATION_TEST_DIRECTORY + "expected_testFeaturesAsIntervals_output.txt"));
    testSpec.executeTest("testFeaturesAsIntervals", this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 89 with IntegrationTestSpec

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

the class AlignAssembledContigsSparkIntegrationTest method testAlignAssembledContigsSparkRunnableMiniCluster.

@Test(dataProvider = "alignAssembledContigsSparkIntegrationTest", groups = "sv")
public void testAlignAssembledContigsSparkRunnableMiniCluster(final AlignAssembledContigsSparkIntegrationTest.AlignAssembledContigsSparkIntegrationTestArgs params) throws Exception {
    MiniClusterUtils.runOnIsolatedMiniCluster(cluster -> {
        final List<String> argsToBeModified = Arrays.asList(new ArgumentsBuilder().add(params.getCommandLineNoApiKey()).getArgsArray());
        final org.apache.hadoop.fs.Path workingDirectory = MiniClusterUtils.getWorkingDir(cluster);
        int idx = 0;
        idx = argsToBeModified.indexOf("--inputAssemblyDir");
        org.apache.hadoop.fs.Path path = new org.apache.hadoop.fs.Path(workingDirectory, "contents.txt");
        File file = new File(argsToBeModified.get(idx + 1));
        cluster.getFileSystem().copyFromLocalFile(new org.apache.hadoop.fs.Path(file.toURI()), path);
        argsToBeModified.set(idx + 1, path.toUri().toString());
        path = new org.apache.hadoop.fs.Path(workingDirectory, "reference.fasta");
        cluster.getFileSystem().copyFromLocalFile(new org.apache.hadoop.fs.Path(SVIntegrationTestDataProvider.reference.toURI()), path);
        path = new org.apache.hadoop.fs.Path(workingDirectory, "reference.fasta.fai");
        cluster.getFileSystem().copyFromLocalFile(new org.apache.hadoop.fs.Path(SVIntegrationTestDataProvider.reference_fai.toURI()), path);
        path = new org.apache.hadoop.fs.Path(workingDirectory, "reference.2bit");
        cluster.getFileSystem().copyFromLocalFile(new org.apache.hadoop.fs.Path(SVIntegrationTestDataProvider.reference_2bit.toURI()), path);
        path = new org.apache.hadoop.fs.Path(workingDirectory, "reference.dict");
        cluster.getFileSystem().copyFromLocalFile(new org.apache.hadoop.fs.Path(SVIntegrationTestDataProvider.reference_dict.toURI()), path);
        idx = argsToBeModified.indexOf("-O");
        path = new org.apache.hadoop.fs.Path(workingDirectory, "alignedContigs.txt");
        argsToBeModified.set(idx + 1, path.toUri().toString());
        new IntegrationTestSpec(String.join(" ", argsToBeModified), SVIntegrationTestDataProvider.dummyExpectedFileNames).executeTest("testAlignAssembledContigsSparkRunnableMiniCluster-", this);
    });
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) 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 90 with IntegrationTestSpec

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

the class ExampleFeatureWalkerIntegrationTest method testExampleFeatureWalker.

@Test
public void testExampleFeatureWalker() throws IOException {
    IntegrationTestSpec testSpec = new IntegrationTestSpec(" -R " + hg19MiniReference + " -I " + TEST_DATA_DIRECTORY + "reads_data_source_test1.bam" + " -F " + TEST_DATA_DIRECTORY + "example_features.bed" + " -auxiliaryVariants " + TEST_DATA_DIRECTORY + "feature_data_source_test.vcf" + " -O %s", Arrays.asList(TEST_OUTPUT_DIRECTORY + "expected_ExampleFeatureWalkerIntegrationTest_output.txt"));
    testSpec.executeTest("testExampleIntervalWalker", this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Aggregations

IntegrationTestSpec (org.broadinstitute.hellbender.utils.test.IntegrationTestSpec)201 CommandLineProgramTest (org.broadinstitute.hellbender.CommandLineProgramTest)200 Test (org.testng.annotations.Test)200 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)80 UserException (org.broadinstitute.hellbender.exceptions.UserException)25 ArgumentsBuilder (org.broadinstitute.hellbender.utils.test.ArgumentsBuilder)14 File (java.io.File)10 Configuration (org.apache.hadoop.conf.Configuration)2 org.apache.hadoop.fs (org.apache.hadoop.fs)2 MiniDFSCluster (org.apache.hadoop.hdfs.MiniDFSCluster)2 SimpleInterval (org.broadinstitute.hellbender.utils.SimpleInterval)2 Path (org.apache.hadoop.fs.Path)1