use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CompareBaseQualitiesIntegrationTest method identicalBamTest.
@Test
public void identicalBamTest() throws Exception {
// This test verifies that if two bams are identical that they produce zero diffs.
final String resourceDir = getTestDataDir() + "/validation/";
final File firstBam = new File(resourceDir, "CEUTrio.HiSeq.WGS.b37.ch20.1m-1m1k.NA12878.bam");
final File secondBam = new File(resourceDir, "CEUTrio.HiSeq.WGS.b37.ch20.1m-1m1k.NA12878.bam");
ArgumentsBuilder args = new ArgumentsBuilder();
args.add(firstBam.getCanonicalPath());
args.add(secondBam.getCanonicalPath());
args.add("--throwOnDiff true");
args.add("--VALIDATION_STRINGENCY SILENT");
final Object result = this.runCommandLine(args);
Assert.assertEquals(result, 0);
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class StructuralVariationDiscoveryPipelineSparkIntegrationTest method testSVDiscoverPipelineRunnableMiniCluster.
@Test(dataProvider = "svDiscoverPipelineSparkIntegrationTest", groups = "sv")
public void testSVDiscoverPipelineRunnableMiniCluster(final StructuralVariationDiscoveryPipelineSparkIntegrationTest.StructuralVariationDiscoveryPipelineSparkIntegrationTestArgs params) throws Exception {
MiniClusterUtils.runOnIsolatedMiniCluster(cluster -> {
final List<String> argsToBeModified = Arrays.asList(new ArgumentsBuilder().add(params.getCommandLineNoApiKey()).getArgsArray());
final Path workingDirectory = MiniClusterUtils.getWorkingDir(cluster);
int idx = 0;
idx = argsToBeModified.indexOf("-I");
Path path = new Path(workingDirectory, "hdfs.bam");
File file = new File(argsToBeModified.get(idx + 1));
cluster.getFileSystem().copyFromLocalFile(new Path(file.toURI()), path);
argsToBeModified.set(idx + 1, path.toUri().toString());
idx = argsToBeModified.indexOf("-R");
path = new Path(workingDirectory, "reference.2bit");
file = new File(argsToBeModified.get(idx + 1));
cluster.getFileSystem().copyFromLocalFile(new Path(file.toURI()), path);
argsToBeModified.set(idx + 1, path.toUri().toString());
idx = argsToBeModified.indexOf("--fastaReference");
path = new Path(workingDirectory, "reference.fasta");
file = new File(argsToBeModified.get(idx + 1));
cluster.getFileSystem().copyFromLocalFile(new Path(file.toURI()), path);
argsToBeModified.set(idx + 1, path.toUri().toString());
idx = argsToBeModified.indexOf("--kmersToIgnore");
path = new Path(workingDirectory, "dummy.kill.kmers");
file = new File(argsToBeModified.get(idx + 1));
cluster.getFileSystem().copyFromLocalFile(new Path(file.toURI()), path);
argsToBeModified.set(idx + 1, path.toUri().toString());
path = new Path(workingDirectory, "reference.fasta.fai");
cluster.getFileSystem().copyFromLocalFile(new Path(SVIntegrationTestDataProvider.reference_fai.toURI()), path);
path = new Path(workingDirectory, "reference.dict");
cluster.getFileSystem().copyFromLocalFile(new Path(SVIntegrationTestDataProvider.reference_dict.toURI()), path);
idx = argsToBeModified.indexOf("-O");
path = new Path(workingDirectory, "variants.vcf");
final String vcfOnHDFS = path.toUri().toString();
argsToBeModified.set(idx + 1, vcfOnHDFS);
idx = argsToBeModified.indexOf("--contigSAMFile");
path = new Path(workingDirectory, "assemblies.sam");
argsToBeModified.set(idx + 1, path.toUri().toString());
idx = argsToBeModified.indexOf("--breakpointIntervals");
path = new Path(workingDirectory, "intervals");
argsToBeModified.set(idx + 1, path.toUri().toString());
idx = argsToBeModified.indexOf("--fastqDir");
path = new Path(workingDirectory, "fastq");
argsToBeModified.set(idx + 1, path.toUri().toString());
runCommandLine(argsToBeModified);
svDiscoveryVCFEquivalenceTest(vcfOnHDFS, SVIntegrationTestDataProvider.EXPECTED_SIMPLE_DEL_VCF, Arrays.asList("ALIGN_LENGTHS", "CTG_NAMES"), true);
});
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class UnmarkDuplicatesIntegrationTest method testUnmarkDuplicates.
@Test(dataProvider = "testUnmarkDuplicatesProvider")
public void testUnmarkDuplicates(String samFile, int duplicateCount, File referenceFile) throws IOException {
final File inputBam = new File(getTestDataDir(), samFile);
Assert.assertEquals(getDuplicateCountForBam(inputBam, referenceFile), duplicateCount, "Wrong number of duplicates in original input file");
final File outputBam = createTempFile("testUnmarkDuplicates", ".bam");
ArgumentsBuilder args = new ArgumentsBuilder();
args.addInput(inputBam).addOutput(outputBam);
if (referenceFile != null) {
args.addReference(referenceFile);
}
runCommandLine(args);
Assert.assertEquals(getDuplicateCountForBam(outputBam, referenceFile), 0, "Duplicates still present after UnmarkDuplicates");
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class GenomicsDBImportIntegrationTest method testCantSpecifyVCFAndSampleNameFile.
@Test(expectedExceptions = CommandLineException.class)
public void testCantSpecifyVCFAndSampleNameFile() {
final ArgumentsBuilder args = new ArgumentsBuilder().addArgument(GenomicsDBImport.SAMPLE_NAME_MAP_LONG_NAME, createTempSampleMapFile().getAbsolutePath()).addArgument(StandardArgumentDefinitions.VARIANT_LONG_NAME, HG_00096).addArgument(GenomicsDBImport.WORKSPACE_ARG_NAME, createTempDir("workspace").getAbsolutePath()).addArgument("L", IntervalUtils.locatableToString(INTERVAL));
runCommandLine(args);
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CollectMultipleMetricsIntegrationTest method test.
@Test(dataProvider = "metricsTestFiles")
public void test(final String fileName, final String referenceName, final String expectedInsertSizeResults) throws IOException {
ArgumentsBuilder args = new ArgumentsBuilder();
String outBase = setupMultipleCollector(args, fileName, referenceName);
// for now, run the only two conforming collectors that we have
args.add("--PROGRAM");
args.add("CollectInsertSizeMetrics");
this.runCommandLine(args.getArgsArray());
validateInsertSizeMetrics(outBase, expectedInsertSizeResults);
}
Aggregations