當前位置: 首頁>>代碼示例>>Python>>正文


Python ProteinGrouper._title方法代碼示例

本文整理匯總了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())
開發者ID:terrycojones,項目名稱:dark-matter,代碼行數:12,代碼來源:test_proteins.py

示例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())
開發者ID:terrycojones,項目名稱:dark-matter,代碼行數:15,代碼來源:test_proteins.py

示例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())
開發者ID:terrycojones,項目名稱:dark-matter,代碼行數:17,代碼來源:test_proteins.py

示例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())
開發者ID:bamueh,項目名稱:dark-matter,代碼行數:19,代碼來源:test_proteins.py


注:本文中的dark.proteins.ProteinGrouper._title方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。