本文整理汇总了Python中dark.intervals.ReadIntervals.coverageCounts方法的典型用法代码示例。如果您正苦于以下问题:Python ReadIntervals.coverageCounts方法的具体用法?Python ReadIntervals.coverageCounts怎么用?Python ReadIntervals.coverageCounts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dark.intervals.ReadIntervals
的用法示例。
在下文中一共展示了ReadIntervals.coverageCounts方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testEmptyCoverageCounts
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverageCounts [as 别名]
def testEmptyCoverageCounts(self):
"""
When no intervals are added, coverageCounts should return an empty
Counter.
"""
ri = ReadIntervals(100)
self.assertEqual({}, ri.coverageCounts())
示例2: testEmptyCoverageCountsOnZeroLengthSequence
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverageCounts [as 别名]
def testEmptyCoverageCountsOnZeroLengthSequence(self):
"""
When no intervals are added, coverageCounts should return an empty
Counter.
"""
ri = ReadIntervals(0)
self.assertEqual({}, ri.coverageCounts())
示例3: coverageCounts
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverageCounts [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()
示例4: testOneIntervalInMiddleCoverageCounts
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverageCounts [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())
示例5: testOneIntervalStartingAtZeroCoverageCounts
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverageCounts [as 别名]
def testOneIntervalStartingAtZeroCoverageCounts(self):
"""
If there is a single interval that starts at zero but doesn't
cover the whole hit, coverageCounts should return the correct result.
"""
ri = ReadIntervals(10)
ri.add(0, 5)
c = Counter([0, 1, 2, 3, 4])
self.assertEqual(c, ri.coverageCounts())
示例6: testOneIntervalExactCoveringCoverageCounts
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverageCounts [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())
示例7: testTwoOverlappingIntervalsInMiddleCoverageCounts
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverageCounts [as 别名]
def testTwoOverlappingIntervalsInMiddleCoverageCounts(self):
"""
If there are two overlapping intervals in the middle of the hit,
coverageCounts should return the correct result.
"""
ri = ReadIntervals(10)
ri.add(5, 7)
ri.add(6, 8)
c = Counter([5, 6, 6, 7])
self.assertEqual(c, ri.coverageCounts())
示例8: testOneIntervalEndingAtHitEndCoverageCounts
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverageCounts [as 别名]
def testOneIntervalEndingAtHitEndCoverageCounts(self):
"""
If there is a single interval that ends at the end of the hit
but doesn't start at zero, coverageCounts should return the correct
result.
"""
ri = ReadIntervals(10)
ri.add(5, 10)
c = Counter([5, 6, 7, 8, 9])
self.assertEqual(c, ri.coverageCounts())
示例9: testOneIntervalCoveringAllExtendingRightCoverageCounts
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverageCounts [as 别名]
def testOneIntervalCoveringAllExtendingRightCoverageCounts(self):
"""
If there is a single interval that spans the whole hit, including
going beyond the hit to the right, coverageCounts should return the
correct result.
"""
ri = ReadIntervals(10)
ri.add(0, 12)
c = Counter([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
self.assertEqual(c, ri.coverageCounts())