此包处理开放目标数据检查。
opentargets-checkomatic的Python项目详细描述
check-o-matic
安装
pip install opentargets-checkomatic
opentargets_checkomatic eval -f platform-api.yml
YAML
文件可以是这样的
checkomatic:client:host:https://open-targets-eu-dev.appspot.comport:443size:100# max size to fetch when query and it is applicablerules:targets:ENSG00000198947:-o.approved_symbol == 'DMD'-o.approved_name == 'dystrophin'-o.tractability.smallmolecule.top_category == 'Unknown'-o.tractability.antibody.top_category == 'Predicted Tractable - High confidence'diseases:Orphanet_908:-o.label == 'Fragile X syndrome'-('eye disease' in o.therapeutic_labels)Orphanet_273:-o.label == 'Steinert myotonic dystrophy'Orphanet_93256:-o.label == 'Fragile X-associated tremor/ataxia syndrome'associations:# these (targets and diseases) use dataframes (t) instead addict.Dict object (o)# those are easier to manipulate and filter bytargets:PRDX1:DMD:-('Orphanet_98896' in to_vlist(jp.parse('data[*].disease.id').find(d)))CD86:-('EFO_0003885' in to_vlist(jp.parse('data[*].disease.id').find(d)))ITGAL:-('EFO_0003767' in to_vlist(jp.parse('data[*].disease.id').find(d)))diseases:Orphanet_93256:EFO_0003767:# NOD2, IL10RA, IL23R, ITGAL in IBD-not set(['NOD2', 'IL10RA', 'ITGAL']) - to_vset(jp.parse('data[*].target.gene_info.symbol').find(d))EFO_0000384:# TNF, PTGS2, PTGS1 in crohns disease-not set(['TNF', 'PTGS2', 'PTGS1']) - to_vset(jp.parse('data[*].target.gene_info.symbol').find(d))EFO_0000249:# APP, SORL1, ABCA7, ADAM10 in alzheimers disease-not set(['APP', 'SORL1', 'ABCA7', 'ADAM10']) - to_vset(jp.parse('data[*].target.gene_info.symbol').find(d))Orphanet_399:# huntington disease-not set(['HTT']) - to_vset(jp.parse('data[*].target.gene_info.symbol').find(d))evidences:ENSG00000102081-Orphanet_908:# http://purl.obolibrary.org/obo/SO_0001583-('missense_variant' in to_vlist(jp.parse('data[*].evidence.evidence_codes_info[*][*].label').find(d)))searches:diseases:"crohndisease":-len(o.data) > 0Orphanet_908:-o.data[0].data.name == 'Fragile X syndrome'-o.data[0].data.association_counts.total > 400-o.data[0].data.association_counts.direct > 400targets:"mt-nd":-len(o.data) > 0stats:-o.data_version == "18.12"-o.targets.total > 28000 and o.targets.total < 50000-o.diseases.total > 10000 and o.diseases.total < 20000-len(o.associations.datatypes.keys()) == 7-('sysbio' in o.associations.datatypes.affected_pathway.datasources)-|-dts = o.associations.datatypes.keys()dss = []for dt in dts:dss += o.associations.datatypes[dt].datasources.keys()output = len(dss) == 19
每个项目可以是
- 单行python布尔表达式
- 将输出变量设置为布尔表达式的多行python代码 数据保留在整个列表的内存中,以检查特定对象
已经注入的东西
- o作为addict.dict对象,对象本身或在o.data字段中有多个结果
- d作为python dict对象,对象本身或在d['data']字段中有多个结果
- jp模块是jsonpath rw的缩写
- to_vlist(iterable)函数将jp find()转换为值列表
- to_vset(iterable)函数将jp find()转换为一组值
规则
- 目标-Ensembl ID
- 疾病-疾病ID(EFO,孤儿,…)
- 关联-你有两个部分,目标和疾病。无论是目标还是疾病,它都会返回与对象的所有关联
- 证据-它返回该关联元组(t,d)的最大大小的证据
- 搜索-你有两个部分,目标和疾病。无论是目标还是疾病,它都会返回按目标或疾病筛选的大小搜索结果
- stats-当前返回带有聚合v3/platform/public/utils/stats端点返回的对象
- metrics-当前返回一个带有聚合v3/platform/public/utils/metrics端点返回的对象
版权所有
版权所有2014-2018 Biogen、Celgene Corporation、EMBL-欧洲生物信息学研究所、葛兰素史克、武田制药公司和Wellcome Sanger研究所
这个软件是作为开放目标项目的一部分开发的。有关详细信息,请参见:http://www.opentargets.org
根据apache许可证2.0版(以下简称“许可证”)授权; 除非符合许可证,否则您不能使用此文件。 您可以在
http://www.apache.org/licenses/LICENSE-2.0
除非适用法律要求或书面同意,否则软件 根据许可证分发是按“原样”分发的, 无任何明示或默示的保证或条件。 有关管理权限的特定语言和 许可下的限制。