use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class ReadsDataSourceUnitTest method testManuallySpecifiedIndicesWithCustomReaderFactoryAndNullWrappers.
@Test(dataProvider = "manuallySpecifiedIndexTestData")
public void testManuallySpecifiedIndicesWithCustomReaderFactoryAndNullWrappers(final List<Path> bams, final List<Path> indices) {
final SamReaderFactory customFactory = SamReaderFactory.makeDefault().validationStringency(ValidationStringency.STRICT);
// ReadsDataSource should not be using the wrapper since the files are not on the Google cloud.
// So we pass this invalid wrapper: if the code tries to use it, it'll blow up.
Function<SeekableByteChannel, SeekableByteChannel> nullWrapper = (SeekableByteChannel) -> null;
try (final ReadsDataSource readsSource = new ReadsDataSource(bams, indices, customFactory, nullWrapper, nullWrapper)) {
Assert.assertTrue(readsSource.indicesAvailable(), "Explicitly-provided indices not detected for bams: " + bams);
final Iterator<GATKRead> queryReads = readsSource.query(new SimpleInterval("1", 1, 300));
int queryCount = 0;
while (queryReads.hasNext()) {
++queryCount;
queryReads.next();
}
Assert.assertEquals(queryCount, 5, "Wrong number of reads returned in query");
}
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class LocalReadShardUnitTest method testShardIteration.
@Test(dataProvider = "ShardIterationTestData")
public void testShardIteration(final Shard<GATKRead> shard, final List<String> expectedReadNames) {
final List<String> actualReadNames = new ArrayList<>();
for (final GATKRead read : shard) {
actualReadNames.add(read.getName());
}
Assert.assertEquals(actualReadNames.size(), expectedReadNames.size(), "Wrong number of reads returned");
Assert.assertEquals(actualReadNames, expectedReadNames, "Wrong reads returned");
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class LocalReadShardUnitTest method testShardLoadReads.
@Test(dataProvider = "ShardIterationTestData")
public void testShardLoadReads(final LocalReadShard shard, final List<String> expectedReadNames) {
final List<String> actualReadNames = new ArrayList<>();
for (final GATKRead read : shard.loadAllReads()) {
actualReadNames.add(read.getName());
}
Assert.assertEquals(actualReadNames.size(), expectedReadNames.size(), "Wrong number of reads returned");
Assert.assertEquals(actualReadNames, expectedReadNames, "Wrong reads returned");
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class LikelihoodRankSumTestUnitTest method makeRead.
private GATKRead makeRead() {
final GATKRead read = ArtificialReadUtils.createArtificialRead(TextCigarCodec.decode("10M"));
read.setMappingQuality(30);
read.setPosition(CONTIG, 1);
return read;
}
use of org.broadinstitute.hellbender.utils.read.GATKRead in project gatk by broadinstitute.
the class LikelihoodRankSumTestUnitTest method testBlowupOnCallWithoutAllele.
@Test(expectedExceptions = IllegalStateException.class)
public void testBlowupOnCallWithoutAllele() {
final LikelihoodRankSumTest ann = new LikelihoodRankSumTest();
final GATKRead read1 = makeRead();
ann.getElementForRead(read1, read1.getStart());
}
Aggregations