本文整理汇总了Python中dark.intervals.ReadIntervals类的典型用法代码示例。如果您正苦于以下问题:Python ReadIntervals类的具体用法?Python ReadIntervals怎么用?Python ReadIntervals使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ReadIntervals类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testEmptyCoverageCountsOnZeroLengthSequence
def testEmptyCoverageCountsOnZeroLengthSequence(self):
"""
When no intervals are added, coverageCounts should return an empty
Counter.
"""
ri = ReadIntervals(0)
self.assertEqual({}, ri.coverageCounts())
示例2: testEmptyCoverageCounts
def testEmptyCoverageCounts(self):
"""
When no intervals are added, coverageCounts should return an empty
Counter.
"""
ri = ReadIntervals(100)
self.assertEqual({}, ri.coverageCounts())
示例3: testOneIntervalCoveringAllExtendingLeftCoverage
def testOneIntervalCoveringAllExtendingLeftCoverage(self):
"""
If there is a single interval that spans the whole hit, including
going negative to the left, coverage should return 1.0.
"""
ri = ReadIntervals(100)
ri.add(-10, 100)
self.assertEqual(1.0, ri.coverage())
示例4: testOneIntervalExactCoveringCoverage
def testOneIntervalExactCoveringCoverage(self):
"""
If there is a single interval that spans the whole hit exactly,
coverage should return 1.0.
"""
ri = ReadIntervals(100)
ri.add(0, 100)
self.assertEqual(1.0, ri.coverage())
示例5: testOneIntervalCoveringAllExtendingRightCoverage
def testOneIntervalCoveringAllExtendingRightCoverage(self):
"""
If there is a single interval that spans the whole hit, including
going beyond the hit to the right, coverage should return 1.0.
"""
ri = ReadIntervals(100)
ri.add(0, 110)
self.assertEqual(1.0, ri.coverage())
示例6: testOneIntervalExactCovering
def testOneIntervalExactCovering(self):
"""
If there is a single interval that spans the whole hit exactly, just
that one interval should be returned by walk, and it should be full.
"""
ri = ReadIntervals(100)
ri.add(0, 100)
self.assertEqual([(self.FULL, (0, 100))], list(ri.walk()))
示例7: testOneIntervalStartingBeforeZeroCoverage
def testOneIntervalStartingBeforeZeroCoverage(self):
"""
If there is a single interval that starts before zero but doesn't
cover the whole hit, coverage should return the correct value.
"""
ri = ReadIntervals(100)
ri.add(-50, 50)
self.assertEqual(0.5, ri.coverage())
示例8: testOneIntervalEndingAfterHitEndCoverage
def testOneIntervalEndingAfterHitEndCoverage(self):
"""
If there is a single interval that ends after the end of the hit
but doesn't start at zero, coverage should return the correct value.
"""
ri = ReadIntervals(100)
ri.add(50, 150)
self.assertEqual(0.5, ri.coverage())
示例9: testEmpty
def testEmpty(self):
"""
When no intervals are added, walk should just return one empty
interval that spans the entire rangoe from 0 to the sequence
length.
"""
ri = ReadIntervals(100)
self.assertEqual([(self.EMPTY, (0, 100))], list(ri.walk()))
示例10: testOneIntervalEndingAfterHitEnd
def testOneIntervalEndingAfterHitEnd(self):
"""
If there is a single interval that ends after the end of the hit
but doesn't start at zero, we should get 2 intervals back from walk,
an empty then a full.
"""
ri = ReadIntervals(100)
ri.add(50, 150)
self.assertEqual([(self.EMPTY, (0, 50)), (self.FULL, (50, 150))], list(ri.walk()))
示例11: testOneIntervalStartingBeforeZero
def testOneIntervalStartingBeforeZero(self):
"""
If there is a single interval that starts before zero but doesn't
cover the whole hit, we should get 2 intervals back from walk,
a full one and then an empty.
"""
ri = ReadIntervals(100)
ri.add(-50, 50)
self.assertEqual([(self.FULL, (-50, 50)), (self.EMPTY, (50, 100))], list(ri.walk()))
示例12: testOneIntervalCoveringAllExtendingBoth
def testOneIntervalCoveringAllExtendingBoth(self):
"""
If there is a single interval that spans the whole hit, including
starting before zero and also going beyond the hit to the right, that
one interval should be returned by walk, and it should be full.
"""
ri = ReadIntervals(100)
ri.add(-10, 110)
self.assertEqual([(self.FULL, (-10, 110))], list(ri.walk()))
示例13: testOneIntervalCoveringAllExtendingLeft
def testOneIntervalCoveringAllExtendingLeft(self):
"""
If there is a single interval that spans the whole hit, including
going negative to the left, that one interval should be returned by
walk, and it should be full.
"""
ri = ReadIntervals(100)
ri.add(-10, 100)
self.assertEqual([(self.FULL, (-10, 100))], list(ri.walk()))
示例14: testTwoOverlappingIntervalsInMiddle
def testTwoOverlappingIntervalsInMiddle(self):
"""
If there are two overlapping intervals in the middle of the hit, we
should get 3 intervals back from walk: empty, full, empty.
"""
ri = ReadIntervals(100)
ri.add(50, 60)
ri.add(55, 70)
self.assertEqual([(self.EMPTY, (0, 50)), (self.FULL, (50, 70)), (self.EMPTY, (70, 100))], list(ri.walk()))
示例15: testOneIntervalExactCoveringCoverageCounts
def testOneIntervalExactCoveringCoverageCounts(self):
"""
If there is a single interval that spans the whole hit exactly,
coverageCounts should return the correct result.
"""
ri = ReadIntervals(10)
ri.add(0, 10)
c = Counter([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
self.assertEqual(c, ri.coverageCounts())