| name | variant-pharmacogenomics |
| description | Query PharmGKB (clinPGx) for pharmacogenomic clinical annotations — how a variant affects drug response, dosing, and adverse reactions. |
| license | MIT license |
| metadata | {"skill-author":"PJLab"} |
| i18n | {"zh":{"description":"查询变异对药物反应的影响。"}} |
PharmGKB (clinPGx) — Pharmacogenomic Annotations
Usage
Tool Description
Query PharmGKB clinical annotations API to find drug-gene-variant interactions.
Database: PharmGKB / clinPGx (https://www.pharmgkb.org/)
API: GET https://api.clinpgx.org/v1/data/clinicalAnnotation?location.fingerprint={rsid}&view=base
Args:
rs_id (str): dbSNP rsID (e.g. "rs7412")
Return:
Clinical annotations: related drugs (chemicals), evidence level (1A/1B/2A/2B/3/4),
related diseases, gene (APOE etc.), phenotype categories (efficacy/toxicity/dosage/PK),
related guidelines and FDA labels.
Return Fields Explanation:
- relatedChemicals: 关联的药物/化合物名称和 PharmGKB ID
- levelOfEvidence.term: 证据级别 (1A=最强, 有CPIC/DPWG指南; 4=最弱, 个案报告)
- location.genes: 变异所在基因
- relatedDiseases: 关联疾病
- types: 注释类型 (Efficacy=疗效, Toxicity=毒性, Dosage=剂量, PK=药代动力学)
- relatedGuidelines: 关联的用药指南 (CPIC, DPWG 等)
- relatedLabels: 关联的 FDA 药品标签
Query Example
requests
rs_id =
url =
resp = requests.get(url, timeout=).json()
(resp, ) resp:
annotations = resp[]
(resp, ):
annotations = resp
:
annotations = []
()
i, ann (annotations):
drugs = [c.get(, ) c ann.get(, [])]
evidence = ann.get(, {}).get(, )
genes = [g.get(, ) g ann.get(, {}).get(, [])]
diseases = [d.get(, ) d ann.get(, [])]
ann_types = ann.get(, [])
()
()
()
()
diseases:
()