use of org.testng.annotations.DataProvider in project gatk by broadinstitute.
the class CombineReadCountsIntegrationTest method testOneSampleOneFileFullTargetInfo.
@Test(dataProvider = "testData")
public void testOneSampleOneFileFullTargetInfo(final List<Target> targets, final List<String> sampleNames, final double[][] counts) throws IOException {
final List<File> inputFiles = createInputCountFiles(targets, sampleNames, counts, true, true);
final File targetFile = createTargetFile(targets);
final File output = runTool(targetFile, inputFiles, null);
// Make sure that the input files are not removed by the tool.
Assert.assertFalse(inputFiles.stream().anyMatch(f -> !f.canRead()));
inputFiles.forEach(File::delete);
targetFile.delete();
Assert.assertTrue(output.canRead());
assertOutputContents(output, targets, sampleNames, counts);
// do the testing here:
output.delete();
}
use of org.testng.annotations.DataProvider in project gatk by broadinstitute.
the class XHMMSegmentCallerBaseIntegrationTest method simulateChainDataProvider.
@DataProvider(name = "simulatedChainData")
public static Object[][] simulateChainDataProvider() {
final Random rdn = new Random(131313);
final List<Object[]> result = simulateChainData(rdn);
return result.toArray(new Object[result.size()][]);
}
use of org.testng.annotations.DataProvider in project gatk by broadinstitute.
the class HetPulldownCalculatorUnitTest method inputGetTumorHetPulldown.
@DataProvider(name = "inputGetTumorHetPulldown")
public Object[][] inputGetTumorHetPulldown() {
final Pulldown tumorHetPulldown = new Pulldown(normalHeader);
tumorHetPulldown.add(new AllelicCount(new SimpleInterval("1", 11522, 11522), 7, 4));
tumorHetPulldown.add(new AllelicCount(new SimpleInterval("1", 12098, 12098), 8, 6));
tumorHetPulldown.add(new AllelicCount(new SimpleInterval("1", 14630, 14630), 9, 8));
tumorHetPulldown.add(new AllelicCount(new SimpleInterval("2", 14689, 14689), 6, 9));
tumorHetPulldown.add(new AllelicCount(new SimpleInterval("2", 14982, 14982), 6, 5));
final IntervalList normalHetIntervals = new IntervalList(tumorHeader);
normalHetIntervals.add(new Interval("1", 11522, 11522));
normalHetIntervals.add(new Interval("1", 12098, 12098));
normalHetIntervals.add(new Interval("1", 14630, 14630));
normalHetIntervals.add(new Interval("2", 14689, 14689));
normalHetIntervals.add(new Interval("2", 14982, 14982));
return new Object[][] { { normalHetIntervals, tumorHetPulldown } };
}
use of org.testng.annotations.DataProvider in project gatk by broadinstitute.
the class HetPulldownCalculatorUnitTest method inputGetPileupBaseCount.
@DataProvider(name = "inputGetPileupBaseCount")
public Object[][] inputGetPileupBaseCount() throws IOException {
try (final SamReader bamReader = SamReaderFactory.makeDefault().open(NORMAL_BAM_FILE)) {
final IntervalList intervals = new IntervalList(bamReader.getFileHeader());
intervals.add(new Interval("1", 100, 100));
intervals.add(new Interval("1", 11000, 11000));
intervals.add(new Interval("1", 14000, 14000));
intervals.add(new Interval("1", 14630, 14630));
final SamLocusIterator locusIterator = new SamLocusIterator(bamReader, intervals);
final Nucleotide.Counter baseCounts1 = makeBaseCounts(0, 0, 0, 0);
final Nucleotide.Counter baseCounts2 = makeBaseCounts(0, 9, 0, 0);
final Nucleotide.Counter baseCounts3 = makeBaseCounts(12, 0, 0, 0);
final Nucleotide.Counter baseCounts4 = makeBaseCounts(0, 0, 8, 9);
if (!locusIterator.hasNext()) {
throw new SAMException("Can't get locus to start iteration. Check that " + NORMAL_BAM_FILE.toString() + " contains 1:0-16000.");
}
final SamLocusIterator.LocusInfo locus1 = locusIterator.next();
final SamLocusIterator.LocusInfo locus2 = locusIterator.next();
final SamLocusIterator.LocusInfo locus3 = locusIterator.next();
final SamLocusIterator.LocusInfo locus4 = locusIterator.next();
locusIterator.close();
return new Object[][] { { locus1, baseCounts1 }, { locus2, baseCounts2 }, { locus3, baseCounts3 }, { locus4, baseCounts4 } };
}
}
use of org.testng.annotations.DataProvider in project gatk by broadinstitute.
the class StructuralVariationDiscoveryPipelineSparkIntegrationTest method createTestData.
@DataProvider(name = "svDiscoverPipelineSparkIntegrationTest")
public Object[][] createTestData() throws IOException {
List<Object[]> tests = new ArrayList<>();
final File tempDirLeft = BaseTest.createTempDir("forLeft");
tempDirLeft.deleteOnExit();
Files.createDirectories(Paths.get(tempDirLeft.getAbsolutePath() + "/fastq"));
tests.add(new Object[] { new StructuralVariationDiscoveryPipelineSparkIntegrationTest.StructuralVariationDiscoveryPipelineSparkIntegrationTestArgs(SVIntegrationTestDataProvider.TEST_BAM_LEFT, SVIntegrationTestDataProvider.KMER_KILL_LIST, SVIntegrationTestDataProvider.ALIGNER_INDEX_IMG, tempDirLeft.getAbsolutePath()) });
final File tempDirRight = BaseTest.createTempDir("forRight");
tempDirRight.deleteOnExit();
Files.createDirectories(Paths.get(tempDirRight.getAbsolutePath() + "/fastq"));
tests.add(new Object[] { new StructuralVariationDiscoveryPipelineSparkIntegrationTest.StructuralVariationDiscoveryPipelineSparkIntegrationTestArgs(SVIntegrationTestDataProvider.TEST_BAM_RIGHT, SVIntegrationTestDataProvider.KMER_KILL_LIST, SVIntegrationTestDataProvider.ALIGNER_INDEX_IMG, tempDirRight.getAbsolutePath()) });
return tests.toArray(new Object[][] {});
}
Aggregations