本文整理汇总了Python中dark.proteins.ProteinGrouper._title方法的典型用法代码示例。如果您正苦于以下问题:Python ProteinGrouper._title方法的具体用法?Python ProteinGrouper._title怎么用?Python ProteinGrouper._title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dark.proteins.ProteinGrouper
的用法示例。
在下文中一共展示了ProteinGrouper._title方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testOneLineInOneFileTitle
# 需要导入模块: from dark.proteins import ProteinGrouper [as 别名]
# 或者: from dark.proteins.ProteinGrouper import _title [as 别名]
def testOneLineInOneFileTitle(self):
"""
If a protein grouper is given one file with one line, its _title method
must return the expected string.
"""
fp = StringIO(
'0.77 46.6 48.1 5 6 74 gi|327|X|I44.6 ubiquitin [Lausannevirus]\n')
pg = ProteinGrouper()
pg.addFile('sample-filename', fp)
self.assertEqual('1 virus found in 1 sample', pg._title())
示例2: testTwoLinesInOneFileTitle
# 需要导入模块: from dark.proteins import ProteinGrouper [as 别名]
# 或者: from dark.proteins.ProteinGrouper import _title [as 别名]
def testTwoLinesInOneFileTitle(self):
"""
If a protein grouper is given one file with two protein lines, each
from a different virus, its _title method must return the expected
string.
"""
fp = StringIO(
'0.77 46.6 48.1 5 6 74 gi|327|X|I44.6 ubiquitin [Lausannevirus]\n'
'0.77 46.6 48.1 5 6 74 gi|327|X|I44.6 ubiquitin [X Virus]\n'
)
pg = ProteinGrouper()
pg.addFile('sample-filename', fp)
self.assertEqual('2 viruses found in 1 sample', pg._title())
示例3: testOneLineInEachOfTwoFilesDifferentVirusesTitle
# 需要导入模块: from dark.proteins import ProteinGrouper [as 别名]
# 或者: from dark.proteins.ProteinGrouper import _title [as 别名]
def testOneLineInEachOfTwoFilesDifferentVirusesTitle(self):
"""
If a protein grouper is given two files, each with one line from
different viruses, its _title method must return the expected string.
"""
fp1 = StringIO(
'0.63 41.3 44.2 9 9 12 gi|327410| protein 77 [Lausannevirus]\n'
)
fp2 = StringIO(
'0.77 46.6 48.1 5 6 74 gi|327409| ubiquitin [HBV]\n'
)
pg = ProteinGrouper()
pg.addFile('sample-filename-1', fp1)
pg.addFile('sample-filename-2', fp2)
self.assertEqual('2 viruses found in 2 samples', pg._title())
示例4: testOneLineInEachOfTwoFilesSamePathogenTitle
# 需要导入模块: from dark.proteins import ProteinGrouper [as 别名]
# 或者: from dark.proteins.ProteinGrouper import _title [as 别名]
def testOneLineInEachOfTwoFilesSamePathogenTitle(self):
"""
If a protein grouper is given two files, each with one line from the
same pathogen, its _title method must return the expected string.
"""
fp1 = StringIO(
'0.63 41.3 44.2 9 9 12 gi|327410| protein 77 [Lausannevirus]\n'
)
fp2 = StringIO(
'0.77 46.6 48.1 5 6 74 gi|327409| ubiquitin [Lausannevirus]\n'
)
pg = ProteinGrouper()
pg.addFile('sample-filename-1', fp1)
pg.addFile('sample-filename-2', fp2)
self.assertEqual(
'Overall, proteins from 1 pathogen were found in 2 samples.',
pg._title())