Bio.ExPasy包

子模块

模块内容

用于通过万维网访问ExPasy资源的代码。

请参阅https://www.expasy.org/

功能:
  • get_prodoc_entry get-prodoc-entry CGI脚本的接口。

  • get_prosite_entry get-prosite-entry CGI脚本的接口。

  • get_prosite_raw get-prosite-raw CGI脚本的接口。

  • get_sprot_raw get-sprot-raw CGI脚本的接口。

Bio.ExPASy.get_prodoc_entry(id, cgi='https://prosite.expasy.org/cgi-bin/prosite/get-prodoc-entry')

以HTML格式获取ExPasy上的PRODoc条目的文本手柄。

>>> from Bio import ExPASy
>>> import os
>>> with ExPASy.get_prodoc_entry('PDOC00001') as in_handle:
...     html = in_handle.read()
...
>>> with open("myprodocrecord.html", "w") as out_handle:
...     length = out_handle.write(html)
...
>>> os.remove("myprodocrecord.html")  # tidy up

对于不存在的密钥XXX,ExPasy返回包含以下文本的HTML格式页面:“当前没有PROSITE条目”

Bio.ExPASy.get_prosite_entry(id, cgi='https://prosite.expasy.org/cgi-bin/prosite/get-prosite-entry')

以HTML格式获取ExPasy上的PROSITE条目的文本手柄。

>>> from Bio import ExPASy
>>> import os
>>> with ExPASy.get_prosite_entry('PS00001') as in_handle:
...     html = in_handle.read()
...
>>> with open("myprositerecord.html", "w") as out_handle:
...     length = out_handle.write(html)
...
>>> os.remove("myprositerecord.html")  # tidy up

对于不存在的密钥XXX,ExPasy返回包含以下文本的HTML格式页面:“当前没有PROSITE条目”

Bio.ExPASy.get_prosite_raw(id, cgi=None)

在ExPasy上获取原始PROSITE或PRODoc记录的文本手柄。

由于ExPasy网站的更改,cgi参数已被废弃。

>>> from Bio import ExPASy
>>> from Bio.ExPASy import Prosite
>>> with ExPASy.get_prosite_raw('PS00001') as handle:
...     record = Prosite.read(handle)
...
>>> print(record.accession)
PS00001

如果标识符不存在,此函数将引发Value错误:

>>> handle = ExPASy.get_prosite_raw("DOES_NOT_EXIST")
Traceback (most recent call last):
    ...
ValueError: Failed to find entry 'DOES_NOT_EXIST' on ExPASy
Bio.ExPASy.get_sprot_raw(id)

在ExPAS上获取原始SwissProt条目的文本手柄。

对于ID为XXX,获取http://www.uniprot.org/uniprot/XXX.txt(根据https://www.expasy.org/expasy_urls.html文档)。

>>> from Bio import ExPASy
>>> from Bio import SwissProt
>>> with ExPASy.get_sprot_raw("O23729") as handle:
...     record = SwissProt.read(handle)
...
>>> print(record.entry_name)
CHS3_BROFI

如果标识符不存在,此函数将引发Value错误:

>>> ExPASy.get_sprot_raw("DOES_NOT_EXIST")
Traceback (most recent call last):
    ...
ValueError: Failed to find SwissProt entry 'DOES_NOT_EXIST'