本文整理匯總了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())