在platform-api.open targets.io上打开目标的客户端restapi
opentargets的Python项目详细描述
打开目标py
在platform-api.open targets.io上打开目标restapi的python客户端
为什么要直接使用这个客户机而不是rest api?
- 包括所有公共方法的包装器,带有查询验证
- 用于最常见调用的工具(例如,即使您不知道目标基因符号的ENSEMBL基因ID,也可以获取目标基因符号的数据)
- 支持使用迭代器模式自动检索分页结果
- 轻松地将查询结果保存为json、csv或excel文件
- 处理身份验证
- 透明地处理合理使用限制
- 遵循由rest api设置的http缓存
- 实验性的http2支持以获得更好的性能(请注意,客户端库是alpha格式的)
- 支持高级SSL和代理配置
python 3.5和更高版本支持此客户端。 尽最大努力在Python2.7上工作。
文档可在ReadTheDocs
快速启动
fromopentargetsimportOpenTargetsClientot=OpenTargetsClient()search_result=ot.search('BRAF')print(search_result[0])a_for_target=ot.get_associations_for_target('BRAF')foraina_for_target:print(a['id'],a['association_score']['overall'])a_for_disease=ot.get_associations_for_disease('cancer')print(ot.get_association('ENSG00000157764-EFO_0005803')[0])e_for_target=ot.get_evidence_for_target('BRAF')print(e_for_target.to_json())e_for_disease=ot.get_evidence_for_disease('medulloblastoma')print(ot.get_evidence('5cf863da265c32d112ff4fc3bfc25ab3')[0])print(ot.get_stats().info)...
贡献
创建开发环境:
git clone <this repo> cd opentargets-py virtualenv venv source venv/bin/activate pip install -r requirements.txt
如何贡献:
- (如果您不是开放目标团队的一员)进行回购
- 从master分支,始终以
git checkout -b yourname-featureyouareadding
开头
- 代码
- 推动分支机构并提交PR
- 为你的公关征求意见
- travis测试必须通过
- 您的公关已被批准并合并
如何释放
- 起草新版本https://github.com/opentargets/opentargets-py/releases/new
- 使用语义版本控制添加标记,指向
master
- 新闻出版
发布版在github控制台中创建后将自动部署到pypi(感谢travis)。