Search in sources :

Example 36 with ArgumentsBuilder

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

the class FlagStatSparkIntegrationTest method flagStatSparkLocalWithBigInterval.

@Test(groups = "spark")
public void flagStatSparkLocalWithBigInterval() throws IOException {
    ArgumentsBuilder args = new ArgumentsBuilder();
    args.addInput(getTestFile("flag_stat.bam"));
    args.add("-L");
    args.add("chr1");
    args.add("-L");
    args.add("chr2");
    args.add("-L");
    args.add("chr3");
    args.add("-L");
    args.add("chr4");
    args.add("-L");
    args.add("chr5");
    args.add("-L");
    args.add("chr6");
    args.add("-L");
    args.add("chr7");
    args.add("-L");
    args.add("chr8");
    File outputFile = createTempFile("flagStatTest", ".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-chr8.txt"), false, null);
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) File(java.io.File) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 37 with ArgumentsBuilder

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

the class BwaAndMarkDuplicatesPipelineSparkIntegrationTest method test.

@Test
public void test() throws Exception {
    //This file was created by 1) running bwaspark on the input and 2) running picard MarkDuplicates on the result
    final File expectedSam = new File(largeFileTestDir, "CEUTrio.HiSeq.WGS.b37.NA12878.20.21.tiny.md.bam");
    final File ref = new File(b37_reference_20_21);
    final File input = new File(largeFileTestDir, "CEUTrio.HiSeq.WGS.b37.NA12878.20.21.tiny.unaligned.bam");
    final File output = createTempFile("bwa", ".bam");
    if (!output.delete()) {
        Assert.fail();
    }
    final ArgumentsBuilder args = new ArgumentsBuilder();
    args.addReference(ref);
    args.addInput(input);
    args.addOutput(output);
    args.addArgument("bwamemIndexImage", b37_reference_20_21 + ".img");
    args.addBooleanArgument("disableSequenceDictionaryValidation", true);
    this.runCommandLine(args.getArgsArray());
    SamAssertionUtils.assertSamsEqual(output, expectedSam);
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) File(java.io.File) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 38 with ArgumentsBuilder

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

the class BaseRecalibratorSparkIntegrationTest method testBQSRSpark.

@Test(dataProvider = "BQSRTest", groups = "spark")
public void testBQSRSpark(BQSRTest params) throws IOException {
    ArgumentsBuilder ab = new ArgumentsBuilder().add(params.getCommandLineNoApiKey());
    IntegrationTestSpec spec = new IntegrationTestSpec(ab.getString(), Arrays.asList(params.expectedFileName));
    spec.executeTest("testBQSRSpark-" + 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 39 with ArgumentsBuilder

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

the class BaseRecalibratorSparkShardedIntegrationTest method testBQSRLocal.

// "local", but we're still getting the reference from the cloud.
//FIXME: disabled because it fails. https://github.com/broadinstitute/gatk/issues/1119
@Test(dataProvider = "BQSRTest", groups = { "spark", "cloud" }, enabled = false)
public void testBQSRLocal(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 40 with ArgumentsBuilder

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

the class CreateHadoopBamSplittingIndexIntegrationTest method testUnindexableFilesFail.

@Test(expectedExceptions = UserException.BadInput.class, dataProvider = "unindexable")
public void testUnindexableFilesFail(final File badFile) {
    final ArgumentsBuilder args = getInputAndOutputArgs(badFile, getTempIndexFile());
    this.runCommandLine(args);
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) 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