uniprot.org的简单接口
uniprot_tools的Python项目详细描述
uniprot提供了一个命令行和python接口来访问 Uniprot数据库
可用服务:地图、检索
map使用uniprots将id列表从一种格式映射到另一种格式 映射API
Args: query: id or list of ids to be mapped f: from ACC | P_ENTREZGENEID | ... t: to ... format: tab by default Help: for a list of all possible mappings visit 'http://www.uniprot.org/faq/28'
retrieve使用批检索由uniprot acc请求条目
Args: query: list of ids to retrieve format: txt by default Help: possible formats: txt, xml, rdf, fasta, gff
安装
来自PYPI(推荐)
pip install uniprot_tools
仅从源(Unix)独立
克隆git存储库
git clone https://github.com/jdrudolph/uniprot.git
使用distutils安装包
cd uniprot sudo python setup.py install
示例
独立
uniprot map ACC P_ENTREZGENEID acc_file map_file
这将从acc_file和 将它们存储到map_file。
uniprot retrieve acc_file entries.txt
检索acc_file中所有uniprot id的文本项并保存到 entries.txt
使用管道:
echo P31749 | uniprot map ACC P_ENTREZGENEID
将结果打印到stdout,可以进一步重定向
echo P31749 | uniprot retrieve
将结果打印到stdout,可以进一步重定向
在python脚本中
import uniprot as uni print uni.map('P31749', f='ACC', t='P_ENTREZGENEID') # map single id print uni.map(['P31749','Q16204'], f='ACC', t='P_ENTREZGENEID') # map list of ids print uni.retrieve('P31749') print uni.retrieve(['P31749','Q16204'])