Search in sources :

Example 71 with ArgumentsBuilder

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

the class GenomicsDBImportIntegrationTest method testRequireOneOfVCFOrSampleNameFile.

@Test(expectedExceptions = CommandLineException.MissingArgument.class)
public void testRequireOneOfVCFOrSampleNameFile() {
    final ArgumentsBuilder args = new ArgumentsBuilder().addArgument(GenomicsDBImport.WORKSPACE_ARG_NAME, createTempDir("workspace").getAbsolutePath()).addArgument("L", "1:1-10");
    runCommandLine(args);
}
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 72 with ArgumentsBuilder

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

the class GenomicsDBImportIntegrationTest method writeToGenomicsDB.

private void writeToGenomicsDB(final List<String> vcfInputs, final SimpleInterval interval, final String workspace, final int batchSize, final Boolean useBufferSize, final int bufferSizePerSample) {
    final ArgumentsBuilder args = new ArgumentsBuilder();
    args.addArgument("genomicsDBWorkspace", workspace);
    args.addArgument("L", IntervalUtils.locatableToString(interval));
    vcfInputs.forEach(vcf -> args.addArgument("V", vcf));
    args.addArgument("batchSize", String.valueOf(batchSize));
    if (useBufferSize)
        args.addArgument("genomicsDBVCFBufferSize", String.valueOf(bufferSizePerSample));
    runCommandLine(args);
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder)

Example 73 with ArgumentsBuilder

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

the class ExampleReadWalkerWithReferenceSparkIntegrationTest 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("--input");
    args.add(TEST_DATA_DIRECTORY + "reads_data_source_test1.bam");
    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_ExampleReadWalkerWithReferenceIntegrationTest_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 74 with ArgumentsBuilder

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

the class CompareBaseQualitiesIntegrationTest method singleReadDiffTest.

@Test(dataProvider = "CompareBasesProvider")
public void singleReadDiffTest(File firstBam, File secondBam, File referenceFile, File outFile, List<Integer> staticQuantizationQuals, String diffFile) throws Exception {
    final String resourceDir = getTestDataDir() + "/validation/";
    ArgumentsBuilder args = new ArgumentsBuilder();
    args.add(firstBam.getCanonicalPath());
    args.add(secondBam.getCanonicalPath());
    args.add("--" + "O");
    args.add(outFile.getCanonicalPath());
    if (null != referenceFile) {
        args.add("-R");
        args.add(referenceFile.getAbsolutePath());
    }
    if (staticQuantizationQuals != null && !staticQuantizationQuals.isEmpty()) {
        for (int sq : staticQuantizationQuals) {
            args.add("-SQQ");
            args.add(sq);
        }
    }
    final Object result = this.runCommandLine(args);
    if (Objects.equals(firstBam, secondBam)) {
        Assert.assertEquals(result, 0);
    } else {
        Assert.assertNotEquals(result, 0);
    }
    final File expected = new File(resourceDir, diffFile);
    IntegrationTestSpec.assertEqualTextFiles(outFile, expected);
}
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 75 with ArgumentsBuilder

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

the class GenotypeGVCFsIntegrationTest method testIntervalsAndOnlyOutputCallsStartingInIntervalsAreMutuallyRequired.

@Test
public void testIntervalsAndOnlyOutputCallsStartingInIntervalsAreMutuallyRequired() {
    ArgumentsBuilder args = new ArgumentsBuilder().addVCF(getTestFile("leadingDeletion.g.vcf")).addReference(new File(b37_reference_20_21)).addOutput(createTempFile("tmp", ".vcf")).addBooleanArgument(GenotypeGVCFs.ONLY_OUTPUT_CALLS_STARTING_IN_INTERVALS_FULL_NAME, true);
    Assert.assertThrows(CommandLineException.MissingArgument.class, () -> runCommandLine(args));
    args.addArgument("L", "20:69512-69513");
    runCommandLine(args);
}
Also used : ArgumentsBuilder(org.broadinstitute.hellbender.utils.test.ArgumentsBuilder) File(java.io.File) CommandLineException(org.broadinstitute.barclay.argparser.CommandLineException) 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