Search in sources :

Example 96 with ArgumentsBuilder

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

the class BaseRecalibratorSparkIntegrationTest method testBQSRBucket.

// TODO: re-enable once ReadsSparkSource natively supports files in GCS buckets
@Test(dataProvider = "BQSRTestBucket", groups = { "spark", "bucket" }, enabled = false)
public void testBQSRBucket(BQSRTest params) throws IOException {
    ArgumentsBuilder ab = new ArgumentsBuilder().add(params.getCommandLine());
    IntegrationTestSpec spec = new IntegrationTestSpec(ab.getString(), Arrays.asList(params.expectedFileName));
    spec.executeTest("testBQSRBucket-" + params.args, this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 97 with ArgumentsBuilder

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

the class BaseRecalibratorSparkIntegrationTest method testBQSRSparkCloud.

@Test(dataProvider = "BQSRCloudTest", groups = { "cloud", "spark" })
public void testBQSRSparkCloud(final BQSRTest params) throws IOException {
    ArgumentsBuilder ab = new ArgumentsBuilder().add(params.getCommandLine());
    IntegrationTestSpec spec = new IntegrationTestSpec(ab.getString(), Arrays.asList(params.expectedFileName));
    spec.executeTest("testBQSRSparkCloud-" + params.args, this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 98 with ArgumentsBuilder

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

the class BaseRecalibratorSparkShardedIntegrationTest method testBQSRBucket.

// this one actually passes, but it takes too long (>10min)! Adding -L speeds it up but then the output's wrong (?)
@Test(dataProvider = "BQSRTestBucket", groups = { "spark", "bucket" }, enabled = false)
public void testBQSRBucket(BQSRTest params) throws IOException {
    ArgumentsBuilder ab = new ArgumentsBuilder().add(params.getCommandLine());
    IntegrationTestSpec spec = new IntegrationTestSpec(ab.getString(), Arrays.asList(params.expectedFileName));
    spec.executeTest("testBQSR-" + params.args, this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 99 with ArgumentsBuilder

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

the class CreateHadoopBamSplittingIndexIntegrationTest method testUnspecifiedOutputProducesAdjacentIndex.

@Test(dataProvider = "indexable")
public void testUnspecifiedOutputProducesAdjacentIndex(final File bam) throws IOException {
    // copy the bam file to a new temp file
    // we're going to write an index next to it on disk, and we don't want to write into the test resources folder
    final File bamCopy = createTempFile("copy-" + bam, ".bam");
    Files.copy(bam.toPath(), bamCopy.toPath(), StandardCopyOption.REPLACE_EXISTING);
    final File expectedIndex = new File(bamCopy.toPath() + SplittingBAMIndexer.OUTPUT_FILE_EXTENSION);
    Assert.assertFalse(expectedIndex.exists());
    final ArgumentsBuilder args = new ArgumentsBuilder().addInput(bamCopy);
    this.runCommandLine(args);
    expectedIndex.deleteOnExit();
    assertIndexIsNotEmpty(expectedIndex);
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) File(java.io.File) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 100 with ArgumentsBuilder

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

the class CreateHadoopBamSplittingIndexIntegrationTest method testBothPathsProduceSameIndex.

@Test
public void testBothPathsProduceSameIndex() throws IOException {
    final File splittingIndexOnly = getTempIndexFile();
    final ArgumentsBuilder splittingIndexOnlyArgs = getInputAndOutputArgs(SORTED_BAM, splittingIndexOnly);
    this.runCommandLine(splittingIndexOnlyArgs);
    assertIndexIsNotEmpty(splittingIndexOnly);
    final File splittingIndexWithBai = getTempIndexFile();
    final ArgumentsBuilder splittingAndBaiArgs = getInputAndOutputArgs(SORTED_BAM, splittingIndexWithBai).add("--" + CreateHadoopBamSplittingIndex.CREATE_BAI_LONG_NAME);
    this.runCommandLine(splittingAndBaiArgs);
    assertIndexIsNotEmpty(splittingIndexWithBai);
    IOUtil.assertFilesEqual(splittingIndexOnly, splittingIndexWithBai);
}
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