use of org.broadinstitute.hellbender.utils.downsampling.ReadsDownsampler in project gatk by broadinstitute.
the class LocalReadShardUnitTest method shardIterationTestData.
@DataProvider(name = "ShardIterationTestData")
public Object[][] shardIterationTestData() {
final ReadsDataSource readsSource = new ReadsDataSource(IOUtils.getPath(publicTestDir + "org/broadinstitute/hellbender/engine/reads_data_source_test1.bam"));
final ReadFilter keepReadBOnly = new ReadFilter() {
private static final long serialVersionUID = 1l;
@Override
public boolean test(GATKRead read) {
return read.getName().equals("b");
}
;
};
final LocalReadShard filteredShard = new LocalReadShard(new SimpleInterval("1", 200, 210), new SimpleInterval("1", 200, 210), readsSource);
filteredShard.setReadFilter(keepReadBOnly);
final ReadsDownsampler readsBAndCOnlyDownsampler = new KeepReadsBAndCOnlyDownsampler();
final LocalReadShard downsampledShard = new LocalReadShard(new SimpleInterval("1", 1, 5000), new SimpleInterval("1", 1, 5000), readsSource);
downsampledShard.setDownsampler(readsBAndCOnlyDownsampler);
return new Object[][] { { new LocalReadShard(new SimpleInterval("1", 200, 210), new SimpleInterval("1", 200, 210), readsSource), Arrays.asList("a", "b", "c") }, { new LocalReadShard(new SimpleInterval("1", 200, 209), new SimpleInterval("1", 200, 209), readsSource), Arrays.asList("a", "b") }, { new LocalReadShard(new SimpleInterval("1", 200, 204), new SimpleInterval("1", 200, 204), readsSource), Arrays.asList("a") }, { new LocalReadShard(new SimpleInterval("1", 200, 204), new SimpleInterval("1", 190, 210), readsSource), Arrays.asList("a", "b", "c") }, { new LocalReadShard(new SimpleInterval("1", 200, 204), new SimpleInterval("1", 200, 205), readsSource), Arrays.asList("a", "b") }, { new LocalReadShard(new SimpleInterval("1", 400, 500), new SimpleInterval("1", 400, 500), readsSource), Collections.<String>emptyList() }, { filteredShard, Arrays.asList("b") }, { downsampledShard, Arrays.asList("b", "c") } };
}
Aggregations