本文整理汇总了Python中dark.titles.TitlesAlignments.summary方法的典型用法代码示例。如果您正苦于以下问题:Python TitlesAlignments.summary方法的具体用法?Python TitlesAlignments.summary怎么用?Python TitlesAlignments.summary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dark.titles.TitlesAlignments
的用法示例。
在下文中一共展示了TitlesAlignments.summary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSummary
# 需要导入模块: from dark.titles import TitlesAlignments [as 别名]
# 或者: from dark.titles.TitlesAlignments import summary [as 别名]
def testSummary(self):
"""
The summary function must return the correct result.
"""
mockOpener = mockOpen(read_data=(
dumps(PARAMS) + '\n' + dumps(RECORD0) + '\n' +
dumps(RECORD1) + '\n'))
with patch.object(builtins, 'open', mockOpener):
reads = Reads()
reads.add(Read('id0', 'A' * 70))
reads.add(Read('id1', 'A' * 70))
readsAlignments = DiamondReadsAlignments(reads, 'file.json',
'database.fasta')
titlesAlignments = TitlesAlignments(readsAlignments)
self.assertEqual(
[
{
'bestScore': 20.0,
'coverage': 0.00031428571428571427,
'hspCount': 1,
'medianScore': 20.0,
'readCount': 1,
'subjectLength': 35000,
'subjectTitle': (
'gi|887699|gb|DQ37780 Monkeypox virus 456'),
},
{
'bestScore': 20.0,
'coverage': 0.00031428571428571427,
'hspCount': 1,
'medianScore': 20.0,
'readCount': 1,
'subjectLength': 35000,
'subjectTitle': (
'gi|887699|gb|DQ37780 Mummypox virus 3000 B.C.'),
},
{
'bestScore': 20.0,
'coverage': 0.0002972972972972973,
'hspCount': 1,
'medianScore': 20.0,
'readCount': 1,
'subjectLength': 37000,
'subjectTitle': (
'gi|887699|gb|DQ37780 Squirrelpox virus 1296/99'),
},
{
'bestScore': 25.0,
'coverage': 0.00028947368421052634,
'hspCount': 1,
'medianScore': 25.0,
'readCount': 1,
'subjectLength': 38000,
'subjectTitle': (
'gi|887699|gb|DQ37780 Squirrelpox virus 55'),
},
],
list(titlesAlignments.summary(sortOn='title')))