当前位置: 首页>>代码示例>>Python>>正文


Python intervals.ReadIntervals类代码示例

本文整理汇总了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())
开发者ID:acorg,项目名称:dark-matter,代码行数:7,代码来源:test_intervals.py

示例2: testEmptyCoverageCounts

 def testEmptyCoverageCounts(self):
     """
     When no intervals are added, coverageCounts should return an empty
     Counter.
     """
     ri = ReadIntervals(100)
     self.assertEqual({}, ri.coverageCounts())
开发者ID:acorg,项目名称:dark-matter,代码行数:7,代码来源:test_intervals.py

示例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())
开发者ID:terrycojones,项目名称:dark-matter,代码行数:8,代码来源:test_intervals.py

示例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())
开发者ID:terrycojones,项目名称:dark-matter,代码行数:8,代码来源:test_intervals.py

示例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())
开发者ID:terrycojones,项目名称:dark-matter,代码行数:8,代码来源:test_intervals.py

示例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()))
开发者ID:sophiemathias,项目名称:dark-matter,代码行数:8,代码来源:test_intervals.py

示例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())
开发者ID:terrycojones,项目名称:dark-matter,代码行数:8,代码来源:test_intervals.py

示例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())
开发者ID:terrycojones,项目名称:dark-matter,代码行数:8,代码来源:test_intervals.py

示例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()))
开发者ID:sophiemathias,项目名称:dark-matter,代码行数:8,代码来源:test_intervals.py

示例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()))
开发者ID:sophiemathias,项目名称:dark-matter,代码行数:9,代码来源:test_intervals.py

示例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()))
开发者ID:sophiemathias,项目名称:dark-matter,代码行数:9,代码来源:test_intervals.py

示例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()))
开发者ID:sophiemathias,项目名称:dark-matter,代码行数:9,代码来源:test_intervals.py

示例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()))
开发者ID:sophiemathias,项目名称:dark-matter,代码行数:9,代码来源:test_intervals.py

示例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()))
开发者ID:sophiemathias,项目名称:dark-matter,代码行数:9,代码来源:test_intervals.py

示例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())
开发者ID:acorg,项目名称:dark-matter,代码行数:9,代码来源:test_intervals.py


注:本文中的dark.intervals.ReadIntervals类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。