use of htsjdk.samtools.util.Locatable in project gatk by broadinstitute.
the class SimpleIntervalUnitTest method testGoodIntervalsFromLocatable.
@Test(dataProvider = "goodIntervals")
public void testGoodIntervalsFromLocatable(String ignoreMe, String contig, int start, int end) {
Locatable l = getLocatable(contig, start, end);
SimpleInterval interval = new SimpleInterval(l);
Assert.assertEquals(interval.getContig(), contig, "contig");
Assert.assertEquals(interval.getStart(), start, "start");
Assert.assertEquals(interval.getEnd(), end, "end");
}
use of htsjdk.samtools.util.Locatable in project gatk by broadinstitute.
the class IntervalsSkipListOneContigUnitTest method testNotSameContig.
@Test(expectedExceptions = IllegalArgumentException.class)
public void testNotSameContig() throws Exception {
List<Locatable> input = Arrays.asList(new SimpleInterval("1", 10, 100), new SimpleInterval("2", 10, 100));
final IntervalsSkipListOneContig<Locatable> l = new IntervalsSkipListOneContig<>(input);
}
use of htsjdk.samtools.util.Locatable in project gatk by broadinstitute.
the class IntervalsSkipListOneContigUnitTest method testNullArg.
@Test(expectedExceptions = IllegalArgumentException.class)
public void testNullArg() throws Exception {
List<Locatable> input = Arrays.asList(new SimpleInterval("1", 10, 100));
final IntervalsSkipListOneContig<Locatable> l = new IntervalsSkipListOneContig<>(input);
l.getOverlapping(null);
}
use of htsjdk.samtools.util.Locatable in project gatk by broadinstitute.
the class IntervalsSkipListOneContigUnitTest method testLotsOfTinyIntervals.
@Test
public void testLotsOfTinyIntervals() throws Exception {
List<Locatable> input = new ArrayList<>();
int n = 1000000;
for (int i = 0; i < n; i++) {
//1:1-2, 1:4-5, 1:7-8
input.add(new SimpleInterval("1", 3 * i + 1, 3 * i + 2));
}
final IntervalsSkipListOneContig<Locatable> skipList = new IntervalsSkipListOneContig<>(input);
final List<Locatable> overlapping = skipList.getOverlapping(new SimpleInterval("1", 1, 3 * n + 2));
Assert.assertEquals(input, overlapping);
}
use of htsjdk.samtools.util.Locatable in project gatk by broadinstitute.
the class IntervalsSkipListOneContigUnitTest method testQquetNotSameContig.
@Test
public void testQquetNotSameContig() throws Exception {
List<Locatable> input = Arrays.asList(new SimpleInterval("1", 10, 100));
final IntervalsSkipListOneContig<Locatable> l = new IntervalsSkipListOneContig<>(input);
final List<Locatable> res = l.getOverlappingIgnoringIndex(new SimpleInterval("2", 10, 100));
Assert.assertEquals(res, Collections.emptyList());
}
Aggregations