本文整理汇总了Python中Bio.ExPASy.get_prosite_entry方法的典型用法代码示例。如果您正苦于以下问题:Python ExPASy.get_prosite_entry方法的具体用法?Python ExPASy.get_prosite_entry怎么用?Python ExPASy.get_prosite_entry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bio.ExPASy
的用法示例。
在下文中一共展示了ExPASy.get_prosite_entry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_prosite_html
# 需要导入模块: from Bio import ExPASy [as 别名]
# 或者: from Bio.ExPASy import get_prosite_entry [as 别名]
def test_prosite_html(self):
handle = ExPASy.get_prosite_entry('PS00001')
html = handle.read()
self.assertEqual(handle.url,
'http://prosite.expasy.org/cgi-bin/prosite/get-prosite-entry?PS00001')
handle.close()
self.assertTrue('<title>PROSITE: PS00001</title>' in html)
示例2: __getitem__
# 需要导入模块: from Bio import ExPASy [as 别名]
# 或者: from Bio.ExPASy import get_prosite_entry [as 别名]
def __getitem__(self, id):
"""__getitem__(self, id) -> object
Return a Prosite entry. id is either the id or accession
for the entry. Raises a KeyError if there's an error.
"""
from Bio import ExPASy
# First, check to see if enough time has passed since my
# last query.
self.limiter.wait()
try:
handle = ExPASy.get_prosite_entry(id)
except IOError:
raise KeyError(id)
try:
handle = File.StringHandle(_extract_record(handle))
except ValueError:
raise KeyError(id)
if self.parser is not None:
return self.parser.parse(handle)
return handle.read()