use of org.broadinstitute.hellbender.utils.SimpleInterval in project gatk by broadinstitute.
the class ReferenceContextUnitTest method testInvalidWindowHandlingAtConstruction.
@Test(dataProvider = "InvalidWindowDataProvider", expectedExceptions = GATKException.class)
public void testInvalidWindowHandlingAtConstruction(final int windowStartOffset, final int windowStopOffset) {
try (ReferenceDataSource reference = new ReferenceFileSource(TEST_REFERENCE)) {
SimpleInterval interval = new SimpleInterval("1", 5, 10);
ReferenceContext refContext = new ReferenceContext(reference, interval, windowStartOffset, windowStopOffset);
}
}
use of org.broadinstitute.hellbender.utils.SimpleInterval in project gatk by broadinstitute.
the class ProgressMeterUnitTest method testProcessingRate.
@Test(dataProvider = "ProcessingRateTestData")
public void testProcessingRate(final ListBasedTimeFunction timeFunction, final long recordsToProcess, final double expectedProcessingRate) {
final ProgressMeter meter = new ProgressMeter(1.0, timeFunction);
meter.start();
for (int i = 1; i <= recordsToProcess; ++i) {
meter.update(new SimpleInterval("1", 1, 1));
}
Assert.assertEquals(meter.processingRate(), expectedProcessingRate, "actual processing rate differs from expected value");
}
use of org.broadinstitute.hellbender.utils.SimpleInterval in project gatk by broadinstitute.
the class ModeledSegmentUnitTest method testSegmentConstructor.
@Test
public void testSegmentConstructor() {
SimpleInterval interval = new SimpleInterval("chr", 1, 2);
String call = "call";
double segmentMean = -0.0001;
final long originalProbeCount = 100;
final ModeledSegment ci = new ModeledSegment(interval, call, originalProbeCount, segmentMean);
Assert.assertEquals(ci.getSimpleInterval(), interval);
Assert.assertEquals(ci.getCall(), call);
Assert.assertEquals(ci.getTargetCount(), originalProbeCount);
Assert.assertEquals(ci.getSegmentMean(), segmentMean);
Assert.assertEquals(ci.getSegmentMeanInCRSpace(), Math.pow(2, segmentMean));
ci.setTargetCount(5);
Assert.assertEquals(ci.getTargetCount(), 5);
double segmentMeanInCRSpace = 2;
ci.setSegmentMeanInCRSpace(segmentMeanInCRSpace);
Assert.assertEquals(ci.getSegmentMeanInCRSpace(), segmentMeanInCRSpace);
Assert.assertEquals(ci.getSegmentMean(), 1.0);
double segmentMeanAgain = 1;
ci.setSegmentMean(segmentMeanAgain);
Assert.assertEquals(ci.getSegmentMeanInCRSpace(), segmentMeanInCRSpace);
Assert.assertEquals(ci.getSegmentMean(), 1.0);
}
use of org.broadinstitute.hellbender.utils.SimpleInterval in project gatk by broadinstitute.
the class HashedListTargetCollectionUnitTest method testTargetName.
@Test(dependsOnMethods = { "testCorrectInitialization", "testTargetCount" })
public void testTargetName() {
for (int i = 0; i < targetDB.targetCount(); i++) {
final SimpleInterval loc = targetDB.target(i);
final String name = targetDB.name(loc);
final SimpleInterval observed = targetDB.target(name);
Assert.assertEquals(observed, loc);
Assert.assertEquals(targetDB.index(name), i);
}
Assert.assertNull(targetDB.target("no-interval"));
Assert.assertEquals(targetDB.index("no-interval"), -1);
}
use of org.broadinstitute.hellbender.utils.SimpleInterval in project gatk by broadinstitute.
the class HashedListTargetCollectionUnitTest method testEmptyRangeObject.
@Test(dependsOnMethods = { "testCorrectInitialization", "testCorrectRangeObjectInitialization" })
public void testEmptyRangeObject() {
final IndexRange range = new IndexRange(0, 0);
final List<SimpleInterval> targets = targetDB.targets(range);
Assert.assertNotNull(targets);
Assert.assertEquals(targets.size(), 0);
}
Aggregations