Search in sources :

Example 91 with ArgumentsBuilder

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

the class CountReadsIntegrationTest method testCountReads.

@Test(dataProvider = "filenames")
public void testCountReads(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, 8l);
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) File(java.io.File) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 92 with ArgumentsBuilder

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

the class CountReadsIntegrationTest method countReads.

private void countReads(final String interval_args, final String fileName, final String referenceName, final long count) {
    final File ORIG_BAM = new File(getTestDataDir(), fileName);
    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());
    }
    args.add(interval_args);
    final Object res = this.runCommandLine(args.getArgsArray());
    Assert.assertEquals(res, count);
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) File(java.io.File)

Example 93 with ArgumentsBuilder

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

the class CountReadsIntegrationTest method testBogusArgs.

@Test(expectedExceptions = CommandLineException.class)
public void testBogusArgs() 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();
    args.add("--fred");
    this.runCommandLine(args.getArgsArray());
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) Test(org.testng.annotations.Test) CommandLineProgramTest(org.broadinstitute.hellbender.CommandLineProgramTest)

Example 94 with ArgumentsBuilder

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

the class ApplyBQSRSparkIntegrationTest method testPRNoFailWithHighMaxCycle.

@Test(groups = "spark")
public void testPRNoFailWithHighMaxCycle() throws IOException {
    String args = " -I " + hiSeqBam + " --bqsr_recal_file " + resourceDir + "HiSeq.1mb.1RG.highMaxCycle.table.gz" + "" + " -O " + createTempFile("ignore", ".me");
    ArgumentsBuilder ab = new ArgumentsBuilder().add(args);
    IntegrationTestSpec spec = new IntegrationTestSpec(ab.getString(), Arrays.<String>asList());
    //this just checks that the tool does not blow up
    spec.executeTest("testPRNoFailWithHighMaxCycle", this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) 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 95 with ArgumentsBuilder

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

the class BaseRecalibratorSparkIntegrationTest method testBlowUpOnBroadcastIncompatibleReference.

@Test(groups = "spark")
public void testBlowUpOnBroadcastIncompatibleReference() throws IOException {
    //this should blow up because broadcast requires a 2bit reference
    final String hiSeqBam_chr20 = getResourceDir() + WGS_B37_CH20_1M_1M1K_BAM;
    final String dbSNPb37_chr20 = getResourceDir() + DBSNP_138_B37_CH20_1M_1M1K_VCF;
    BQSRTest params = new BQSRTest(b37_reference_20_21, hiSeqBam_chr20, dbSNPb37_chr20, "-indelBQSR -enableBAQ " + "--joinStrategy BROADCAST", getResourceDir() + BQSRTestData.EXPECTED_WGS_B37_CH20_1M_1M1K_RECAL);
    ArgumentsBuilder ab = new ArgumentsBuilder().add(params.getCommandLineNoApiKey());
    IntegrationTestSpec spec = new IntegrationTestSpec(ab.getString(), 1, UserException.Require2BitReferenceForBroadcast.class);
    spec.executeTest("testBQSR-" + params.args, this);
}
Also used : IntegrationTestSpec(org.broadinstitute.hellbender.utils.test.IntegrationTestSpec) ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) UserException(org.broadinstitute.hellbender.exceptions.UserException) 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