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


Python ReadIntervals.add方法代码示例

本文整理汇总了Python中dark.intervals.ReadIntervals.add方法的典型用法代码示例。如果您正苦于以下问题:Python ReadIntervals.add方法的具体用法?Python ReadIntervals.add怎么用?Python ReadIntervals.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dark.intervals.ReadIntervals的用法示例。


在下文中一共展示了ReadIntervals.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testOneIntervalExactCoveringCoverage

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 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,代码行数:10,代码来源:test_intervals.py

示例2: testOneIntervalExactCovering

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 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,代码行数:10,代码来源:test_intervals.py

示例3: testOneIntervalCoveringAllExtendingLeftCoverage

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 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,代码行数:10,代码来源:test_intervals.py

示例4: testOneIntervalCoveringAllExtendingRightCoverage

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 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,代码行数:10,代码来源:test_intervals.py

示例5: testOneIntervalStartingBeforeZeroCoverage

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 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,代码行数:10,代码来源:test_intervals.py

示例6: testOneIntervalEndingAfterHitEndCoverage

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 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,代码行数:10,代码来源:test_intervals.py

示例7: testOneIntervalEndingAfterHitEnd

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 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,代码行数:11,代码来源:test_intervals.py

示例8: testOneIntervalStartingBeforeZero

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 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,代码行数:11,代码来源:test_intervals.py

示例9: testOneIntervalCoveringAllExtendingBoth

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 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,代码行数:11,代码来源:test_intervals.py

示例10: testOneIntervalCoveringAllExtendingLeft

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 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,代码行数:11,代码来源:test_intervals.py

示例11: testOneIntervalExactCoveringCoverageCounts

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 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,代码行数:11,代码来源:test_intervals.py

示例12: coverageCounts

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 def coverageCounts(self):
     """
     For each location in the title sequence, return a count of how many
     times that location is covered by a read.
     """
     intervals = ReadIntervals(self.subjectLength)
     for hsp in self.hsps():
         intervals.add(hsp.subjectStart, hsp.subjectEnd)
     return intervals.coverageCounts()
开发者ID:acorg,项目名称:dark-matter,代码行数:11,代码来源:titles.py

示例13: testOneIntervalInMiddle

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
    def testOneIntervalInMiddle(self):
        """
        If there is a single interval in the middle of the hit, we
        should get 3 intervals back from walk: empty, full, empty.

        """
        ri = ReadIntervals(100)
        ri.add(50, 60)
        self.assertEqual([(self.EMPTY, (0, 50)), (self.FULL, (50, 60)), (self.EMPTY, (60, 100))], list(ri.walk()))
开发者ID:sophiemathias,项目名称:dark-matter,代码行数:11,代码来源:test_intervals.py

示例14: testOneIntervalInMiddleCoverage

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
    def testOneIntervalInMiddleCoverage(self):
        """
        If there is a single interval in the middle of the hit, coverage
        should return the correct value.

        """
        ri = ReadIntervals(100)
        ri.add(50, 60)
        self.assertEqual(0.1, ri.coverage())
开发者ID:terrycojones,项目名称:dark-matter,代码行数:11,代码来源:test_intervals.py

示例15: testOneIntervalInMiddleCoverageCounts

# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import add [as 别名]
 def testOneIntervalInMiddleCoverageCounts(self):
     """
     If there is a single interval in the middle of the hit, coverageCounts
     should return the correct result.
     """
     ri = ReadIntervals(10)
     ri.add(5, 6)
     c = Counter([5])
     self.assertEqual(c, ri.coverageCounts())
开发者ID:acorg,项目名称:dark-matter,代码行数:11,代码来源:test_intervals.py


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