use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class DiscoverVariantsFromContigAlignmentsSAMSparkIntegrationTest method testDiscoverVariantsRunnableMiniCluster.
@Test(dataProvider = "discoverVariantsFromContigAlignmentsSparkIntegrationTest", groups = "sv")
public void testDiscoverVariantsRunnableMiniCluster(final DiscoverVariantsFromContigAlignmentsSAMSparkIntegrationTestArgs 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.sam");
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());
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);
runCommandLine(argsToBeModified);
StructuralVariationDiscoveryPipelineSparkIntegrationTest.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 DiscoverVariantsFromContigAlignmentsSAMSparkIntegrationTest method testDiscoverVariantsRunnableLocal.
@Test(dataProvider = "discoverVariantsFromContigAlignmentsSparkIntegrationTest", groups = "sv")
public void testDiscoverVariantsRunnableLocal(final DiscoverVariantsFromContigAlignmentsSAMSparkIntegrationTestArgs params) throws Exception {
final List<String> args = Arrays.asList(new ArgumentsBuilder().add(params.getCommandLineNoApiKey()).getArgsArray());
runCommandLine(args);
StructuralVariationDiscoveryPipelineSparkIntegrationTest.svDiscoveryVCFEquivalenceTest(args.get(args.indexOf("-O") + 1), SVIntegrationTestDataProvider.EXPECTED_SIMPLE_DEL_VCF, Arrays.asList("ALIGN_LENGTHS", "CTG_NAMES"), false);
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CollectMultipleMetricsSparkIntegrationTest method testBuiltInCollectors.
@Test(dataProvider = "metricsTestFiles", groups = "spark")
public void testBuiltInCollectors(final String fileName, final String referenceName, final String expectedInsertSizeResults, final String expectedQualityYieldResults) 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("--collectors");
args.add("CollectInsertSizeMetrics");
args.add("--collectors");
args.add("CollectQualityYieldMetrics");
this.runCommandLine(args.getArgsArray());
validateInsertSizeMetrics(outBase, expectedInsertSizeResults);
validateQualityYieldMetrics(outBase, expectedQualityYieldResults);
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class CollectQualityYieldMetricsSparkIntegrationTest method test.
@Test(dataProvider = "CollectQualityYieldMetrics", groups = "spark")
public void test(final String inName, final String outName, final String referenceName, final boolean useOQ) throws IOException {
final File input = new File(TEST_DATA_DIR, inName);
//file created using picard 1.130
final File expectedFile = new File(TEST_DATA_DIR, outName);
final File outfile = BaseTest.createTempFile("testCollectQualityYield", ".metrics");
ArgumentsBuilder args = new ArgumentsBuilder();
args.add("--I");
args.add(input.getCanonicalPath());
args.add("--O");
args.add(outfile.getCanonicalPath());
if (null != referenceName) {
final File REF = new File(referenceName);
args.add("--R");
args.add(REF.getAbsolutePath());
}
args.add("-OQ");
args.add(String.valueOf(useOQ));
runCommandLine(args.getArgsList());
IntegrationTestSpec.assertEqualTextFiles(outfile, expectedFile, "#");
}
use of org.broadinstitute.hellbender.utils.test.ArgumentsBuilder in project gatk by broadinstitute.
the class MeanQualityByCycleSparkIntegrationTest method test.
@Test(dataProvider = "filenames", groups = { "R", "spark" })
public void test(final String inputFile, final String referenceName) throws IOException {
final File input = new File(TEST_DATA_DIR, inputFile);
final File expectedFile = new File(TEST_DATA_DIR, "meanqualbycycle.txt");
final File outfile = BaseTest.createTempFile("testMeanQualityByCycle", ".metrics");
final File pdf = BaseTest.createTempFile("testMeanQualityByCycle", ".pdf");
outfile.deleteOnExit();
pdf.deleteOnExit();
final ArgumentsBuilder args = new ArgumentsBuilder();
args.add("--input");
args.add(input.getAbsolutePath());
args.add("--output");
args.add(outfile.getAbsolutePath());
args.add("--chart");
args.add(pdf.getAbsolutePath());
if (null != referenceName) {
final File REF = new File(referenceName);
args.add("-R");
args.add(REF.getAbsolutePath());
}
runCommandLine(args.getArgsArray());
try (final FileReader actualReader = new FileReader(outfile)) {
final MetricsFile<?, Integer> output = new MetricsFile<>();
output.read(actualReader);
Assert.assertEquals(output.getAllHistograms().size(), 1);
Assert.assertEquals(output.getHistogram().size(), 202);
}
Assert.assertTrue(pdf.exists(), "exists");
Assert.assertTrue(pdf.length() > 0, "length");
IntegrationTestSpec.assertEqualTextFiles(outfile, expectedFile, "#");
}
Aggregations