本文整理汇总了Python中dark.titles.TitleAlignments.coverageInfo方法的典型用法代码示例。如果您正苦于以下问题:Python TitleAlignments.coverageInfo方法的具体用法?Python TitleAlignments.coverageInfo怎么用?Python TitleAlignments.coverageInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dark.titles.TitleAlignments
的用法示例。
在下文中一共展示了TitleAlignments.coverageInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testCoverageInfoNoReads
# 需要导入模块: from dark.titles import TitleAlignments [as 别名]
# 或者: from dark.titles.TitleAlignments import coverageInfo [as 别名]
def testCoverageInfoNoReads(self):
"""
When a title has no reads aligned to it, the coverageInfo method
must return an empty result.
"""
titleAlignments = TitleAlignments('subject title', 55)
coverage = titleAlignments.coverageInfo()
self.assertEqual({}, coverage)
示例2: testCoverageInfoOneReadWithOneHSP
# 需要导入模块: from dark.titles import TitleAlignments [as 别名]
# 或者: from dark.titles.TitleAlignments import coverageInfo [as 别名]
def testCoverageInfoOneReadWithOneHSP(self):
"""
When a title has one read with one HSP aligned to it, the coverageInfo
method must return just the indices and bases from that read.
"""
titleAlignments = TitleAlignments('subject title', 55)
hsp = HSP(15, subjectStart=3, subjectEnd=6, readMatchedSequence='CGT')
read = Read('id1', 'AAACGT')
titleAlignment = TitleAlignment(read, [hsp])
titleAlignments.addAlignment(titleAlignment)
coverage = titleAlignments.coverageInfo()
self.assertEqual(
{
3: [(15, 'C')],
4: [(15, 'G')],
5: [(15, 'T')],
},
coverage)
示例3: testCoverageInfoOneReadWithTwoHSPs
# 需要导入模块: from dark.titles import TitleAlignments [as 别名]
# 或者: from dark.titles.TitleAlignments import coverageInfo [as 别名]
def testCoverageInfoOneReadWithTwoHSPs(self):
"""
When a title has one read with two HSPs aligned to it, the coverageInfo
method must return the correct indices and bases from that read.
"""
titleAlignments = TitleAlignments('subject title', 55)
hsp1 = HSP(15, subjectStart=1, subjectEnd=4, readMatchedSequence='A-A')
hsp2 = HSP(10, subjectStart=3, subjectEnd=6, readMatchedSequence='CGT')
read = Read('id1', 'AAACGT')
titleAlignment = TitleAlignment(read, [hsp1, hsp2])
titleAlignments.addAlignment(titleAlignment)
coverage = titleAlignments.coverageInfo()
self.assertEqual(
{
1: [(15, 'A')],
2: [(15, '-')],
3: [(15, 'A'), (10, 'C')],
4: [(10, 'G')],
5: [(10, 'T')],
},
coverage)
示例4: testCoverageInfoTwoReadsWithThreeHSPs
# 需要导入模块: from dark.titles import TitleAlignments [as 别名]
# 或者: from dark.titles.TitleAlignments import coverageInfo [as 别名]
def testCoverageInfoTwoReadsWithThreeHSPs(self):
"""
When a title has two reads (one with two HSPs, one with one) aligned
to it, the coverageInfo method must return the correct indices and
bases from the read.
"""
titleAlignments = TitleAlignments('subject title', 55)
# First read.
hsp1 = HSP(15, subjectStart=1, subjectEnd=4, readMatchedSequence='A-A')
hsp2 = HSP(10, subjectStart=3, subjectEnd=6, readMatchedSequence='CGT')
read = Read('id1', 'AAACGT')
titleAlignment = TitleAlignment(read, [hsp1, hsp2])
titleAlignments.addAlignment(titleAlignment)
# Second read.
hsp1 = HSP(20, subjectStart=5, subjectEnd=10,
readMatchedSequence='CGGTA')
read = Read('id2', 'AAACGTCGGTAAAA')
titleAlignment = TitleAlignment(read, [hsp1])
titleAlignments.addAlignment(titleAlignment)
coverage = titleAlignments.coverageInfo()
self.assertEqual(
{
1: [(15, 'A')],
2: [(15, '-')],
3: [(15, 'A'), (10, 'C')],
4: [(10, 'G')],
5: [(10, 'T'), (20, 'C')],
6: [(20, 'G')],
7: [(20, 'G')],
8: [(20, 'T')],
9: [(20, 'A')],
},
coverage)