biothings api服务的python客户端。

biothings-client的Python项目详细描述


https://badge.fury.io/py/biothings-client.svghttps://img.shields.io/pypi/pyversions/biothings-client.svghttps://img.shields.io/pypi/format/biothings-client.svghttps://travis-ci.org/biothings/biothings_client.py.svg?branch=masterCodacy Badge

简介

biothings\u client是一个易于使用的python包装器,可以访问任何Biothings.api -基于后端服务。目前,以下客户端可用:

  • gene - The client for MyGene.Info, which provides access to gene objects.
  • variant - The client MyVariant.Info, which provides access to genetic variant objects.
  • chem - The client for MyChem.Info, which provides access to chemical/drug objects.
  • disease - The client for MyDisease.Info, which provides access to disease objects.
  • taxon - The client for t.biothings.io, which provides access to taxon objects.

要求

python >=2.7 (including all python3 versions)

(It may still work under python 2.6, but it’s not supported any more.)

requests (install using “pip install requests”)

可选依赖项

  • pandas (install using “pip install pandas”) is required for returning a list of variant objects as DataFrame.
  • requests_cache (install using “pip install requests_cache”) is required for local caching of API requests.

安装

Option 1
pip install biothings_client
Option 2

download/extract the source code and run:

python setup.py install
Option 3

install the latest code directly from the repository:

pip install -e git+https://github.com/biothings/biothings_client.py

版本历史记录

CHANGES.txt

用法

In[1]:frombiothings_clientimportget_client# get a client for variant objectsIn[2]:mv=get_client("variant")In[3]:mv.getvariant("chr7:g.140453134T>C")Out[3]:#output below is collapsed{"_id":"chr7:g.140453134T>C","_version":1,"chrom":"7","cadd":{...},"clinvar":{...},"cosmic":{...},"dbnsfp":{...},"dbsnp":{...},"docm":{...},"hg19":{'end':140453134,'start':140453134},"mutdb":{...},"snpeff":{...},"vcf":{"alt":"C","position":"140453134","ref":"T"}}# get a client for gene objectsIn[7]:mg=get_client("gene")In[8]:mg.getgene(1017,'name,symbol,refseq')Out[8]:{'_id':'1017','_score':21.03413,'name':'cyclin dependent kinase 2','refseq':{'genomic':['NC_000012.12','NC_018923.2','NG_034014.1'],'protein':['NP_001277159.1','NP_001789.2','NP_439892.2','XP_011536034.1'],'rna':['NM_001290230.1','NM_001798.4','NM_052827.3','XM_011537732.1'],'translation':[{'protein':'NP_001789.2','rna':'NM_001798.4'},{'protein':'NP_439892.2','rna':'NM_052827.3'},{'protein':'NP_001277159.1','rna':'NM_001290230.1'},{'protein':'XP_011536034.1','rna':'XM_011537732.1'}]},'symbol':'CDK2'}# get a client for chems/drugsIn[9]:md=get_client("chem")In[10]:md.getchem("ATBDZSAENDYQDW-UHFFFAOYSA-N",fields="pubchem")Out[10]:{'_id':'ATBDZSAENDYQDW-UHFFFAOYSA-N','_version':1,'pubchem':{'chiral_atom_count':0,'chiral_bond_count':0,'cid':'CID4080429','complexity':250,'covalently-bonded_unit_count':1,'defined_atom_stereocenter_count':0,'defined_bond_stereocenter_count':0,'exact_mass':184.019415,'formal_charge':0,'heavy_atom_count':12,'hydrogen_bond_acceptor_count':3,'hydrogen_bond_donor_count':1,'inchi':'InChI=1S/C8H8O3S/c1-2-7-4-3-5-8(6-7)12(9,10)11/h2-6H,1H2,(H,9,10,11)','inchi_key':'ATBDZSAENDYQDW-UHFFFAOYSA-N','isotope_atom_count':0,'iupac':{'traditional':'3-vinylbesylic acid'},'molecular_formula':'C8H8O3S','molecular_weight':184.21232,'monoisotopic_weight':184.019415,'rotatable_bond_count':2,'smiles':{'isomeric':'C=CC1=CC(=CC=C1)S(=O)(=O)O'},'tautomers_count':1,'topological_polar_surface_area':62.8,'undefined_atom_stereocenter_count':0,'undefined_bond_stereocenter_count':0,'xlogp':1.4}}# get a client for taxaIn[11]:mt=get_client("taxon")In[12]:mt.gettaxon(9606)Out[12]:{'_id':'9606','_version':1,'authority':['homo sapiens linnaeus, 1758'],'common_name':'man','genbank_common_name':'human','has_gene':True,'lineage':[9606,9605,207598,9604,314295,9526,314293,376913,9443,314146,1437010,9347,32525,40674,32524,32523,1338369,8287,117571,117570,7776,7742,89593,7711,33511,33213,6072,33208,33154,2759,131567,1],'other_names':['humans'],'parent_taxid':9605,'rank':'species','scientific_name':'homo sapiens','taxid':9606,'uniprot_name':'homo sapiens'}

联系人

给我们任何反馈@biothingsapi

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java FloatingAction按钮与RecyclerView中的CardView重叠   java如何计算CardLayout中的卡数   从远程系统上传MySQL数据库并访问Java应用程序   java调用堆栈如何处理带或不带返回类型的递归?   Springboot中的java组计数聚集   java如何在javafx textarea中使用richtextfx   获取与Mockito相关的错误时出现Java问题   java如何将JaxRS响应转换为Wiremock响应   Hadoop集群java。net ConnectionException:连接被拒绝错误   java如何加载文件私有文件类型是pem   java在元空间中的提升和加载的类   如何将系统属性传递给从HTML启动的Java小程序   java如何从网页中获取值并在主类中使用它?安卓应用   java在春天,advisor和aspect之间有什么区别?   java如何检测文件是否已重命名?   java消息驱动Bean何时使用