本文整理汇总了Python中dark.intervals.ReadIntervals.coverage方法的典型用法代码示例。如果您正苦于以下问题:Python ReadIntervals.coverage方法的具体用法?Python ReadIntervals.coverage怎么用?Python ReadIntervals.coverage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dark.intervals.ReadIntervals
的用法示例。
在下文中一共展示了ReadIntervals.coverage方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testOneIntervalEndingAfterHitEndCoverage
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [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())
示例2: testOneIntervalCoveringAllExtendingRightCoverage
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [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())
示例3: testOneIntervalStartingBeforeZeroCoverage
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [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())
示例4: testOneIntervalCoveringAllExtendingLeftCoverage
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [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())
示例5: testOneIntervalExactCoveringCoverage
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [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())
示例6: testTwoOverlappingIntervalsInMiddleCoverage
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [as 别名]
def testTwoOverlappingIntervalsInMiddleCoverage(self):
"""
If there are two overlapping intervals in the middle of the hit,
coverage should return the correct value.
"""
ri = ReadIntervals(100)
ri.add(50, 60)
ri.add(55, 70)
self.assertEqual(0.2, ri.coverage())
示例7: testOneIntervalInMiddleCoverage
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [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())
示例8: testOneIntervalCoveringAllExtendingBothCoverage
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [as 别名]
def testOneIntervalCoveringAllExtendingBothCoverage(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,
coverage should return 1.0
"""
ri = ReadIntervals(100)
ri.add(-10, 110)
self.assertEqual(1.0, ri.coverage())
示例9: coverage
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [as 别名]
def coverage(self):
"""
Get the fraction of this title sequence that is matched by its reads.
@return: The C{float} fraction of the title sequence matched by its
reads.
"""
intervals = ReadIntervals(self.subjectLength)
for hsp in self.hsps():
intervals.add(hsp.subjectStart, hsp.subjectEnd)
return intervals.coverage()
示例10: testOverlappingIntervalsThatCoverEverythingCoverage
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [as 别名]
def testOverlappingIntervalsThatCoverEverythingCoverage(self):
"""
If there are sets of overlapping intervals that cover the whole hit,
coverage should return the correct value.
"""
ri = ReadIntervals(100)
ri.add(-10, 20)
ri.add(15, 40)
ri.add(40, 70)
ri.add(66, 89)
ri.add(77, 93)
ri.add(70, 110)
self.assertEqual(1.0, ri.coverage())
示例11: testPairOfTwoOverlappingIntervalsCoverage
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [as 别名]
def testPairOfTwoOverlappingIntervalsCoverage(self):
"""
If there are two sets of two overlapping intervals in the middle of
the hit, coverage should return the correct value.
"""
ri = ReadIntervals(100)
# First overlapping pair, 50-70.
ri.add(50, 60)
ri.add(55, 70)
# First overlapping pair, 80-95.
ri.add(80, 90)
ri.add(85, 95)
self.assertEqual(0.35, ri.coverage())
示例12: testEmptyCoverage
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [as 别名]
def testEmptyCoverage(self):
"""
When no intervals are added, coverage should return 0.0
"""
ri = ReadIntervals(100)
self.assertEqual(0.0, ri.coverage())
示例13: testEmptyCoverageOnZeroLengthSequence
# 需要导入模块: from dark.intervals import ReadIntervals [as 别名]
# 或者: from dark.intervals.ReadIntervals import coverage [as 别名]
def testEmptyCoverageOnZeroLengthSequence(self):
"""
When no intervals are added, coverage should return 0.0
"""
ri = ReadIntervals(0)
self.assertEqual(0.0, ri.coverage())