ClinPGx Database
Overview
ClinPGx (Clinical Pharmacogenomics Database) is a comprehensive resource for
clinical pharmacogenomics, the successor to PharmGKB. It consolidates data from
PharmGKB, CPIC, and PharmCAT, providing curated information on how genetic
variation affects medication response. Access gene-drug pairs, clinical
guidelines, allele functions, and drug labels for precision medicine.
When to Use This Skill
Use this skill for:
- Gene-drug interactions — how variants affect drug metabolism, efficacy, or toxicity
- CPIC guidelines — evidence-based clinical practice guidelines for pharmacogenetics
- Allele information — allele function, frequency, and phenotype data
- Drug labels — FDA and other regulatory pharmacogenomic labeling
- Pharmacogenomic annotations — curated literature on gene-drug-disease relationships
- Clinical decision support — PharmDOG for phenoconversion and custom genotype interpretation
- Precision medicine / personalized dosing — genotype-guided dosing recommendations
- Drug metabolism — CYP450 and other pharmacogene functions
- Adverse drug reactions — genetic risk factors for drug toxicity
Setup and Access Essentials
Only requests is needed. Run the helper script (or any snippet) with an
ephemeral dependency — no venv to manage:
uv run --with requests python scripts/query_clinpgx.py
# or, inside an existing project venv: uv pip install requests
Base URL: https://api.clinpgx.org/v1/data/
- Resource addressing: ClinPGx resources are addressed by ClinPGx accession
IDs in the path (e.g. gene CYP2D6 =
PA128, CYP2C9 = PA126), not by gene
symbols or rsIDs. To resolve a symbol or rsID, query the collection endpoint
with parameters (e.g. GET /v1/data/gene?symbol=CYP2D6,
GET /v1/data/variant?symbol=rs4244285) and read the accession ID from the
response.
- Response envelope (verified): every response is a JSON object
{"status": "success"|"fail", "data": [...]} — the payload is never a bare
list. Read results from response.json()["data"]; on status == "fail",
data is {"errors": [...]} (e.g. "No results matching criteria").
- Query-param convention (verified): genes filter on
relatedGenes.symbol
(the .name form fails), while chemicals/drugs filter on
relatedChemicals.name — relatedChemicals.symbol silently returns
status: "fail" with zero results. The gene collection takes ?symbol=, the
chemical collection takes ?name=, and variant accepts ?symbol=/?name=.
- Rate limits: 2 requests per second maximum; excessive requests return HTTP
- Implement a ~500ms delay between requests.
- Authentication: Not required for basic access.
- Data license: Creative Commons Attribution-ShareAlike 4.0 International.
- For substantial API use, notify the ClinPGx team at api@clinpgx.org.
Core Workflow
- Resolve identifiers — Convert gene symbols / rsIDs to ClinPGx accession
IDs via collection endpoints with
symbol= parameters.
- Query the relevant resource —
gene, chemical, guidelineAnnotation,
summaryAnnotation, variantAnnotation, variant, label, or pathway.
There is no /allele resource — use PharmVar (https://www.pharmvar.org/)
for star-allele definitions and population frequencies.
- Derive gene-drug relationships — From guideline annotations
(
relatedGenes.symbol for genes, relatedChemicals.name for drugs), or the
/report/pair/{firstObjId}/{secondObjId}/{resultType} endpoint.
- Filter by evidence level — Prefer levels 1A/1B/2A for clinical use;
confirm field names against the live OpenAPI spec.
- Respect rate limits — Throttle, retry on 429 with backoff, and cache.
For ready-made functions with rate limiting and error handling, see
scripts/query_clinpgx.py.
Routing Guidance
- Need the exact code for a resource (gene, chemical, gene-drug pair, CPIC
guideline, allele/PharmVar, variant, clinical annotation, label, pathway)?
Read
references/endpoints-and-capabilities.md.
- Doing an end-to-end task (clinical decision support, gene-panel analysis,
drug-safety assessment, population pharmacogenomics, literature review) or a
common use case? Read
references/query-workflows.md.
- Need robust API plumbing (rate limiting, retries, caching)? Read
references/rate-limiting-and-error-handling.md.
- Need full endpoint/parameter/schema details? Read
references/api_reference.md.
References
references/api_reference.md — Complete endpoint listing, request/response
formats, filter operators, data schemas, rate-limit details, and
troubleshooting.
references/endpoints-and-capabilities.md — Worked code for all nine
capability areas (gene, drug/chemical, gene-drug pair, CPIC guidelines,
allele/PharmVar, variant, clinical annotations, drug labels, pathways),
including key pharmacogenes and evidence-level definitions.
references/query-workflows.md — Five end-to-end workflows (decision support,
gene panel, drug safety, population pharmacogenomics, literature review) plus
common use cases (pre-emptive testing, medication therapy management, trial
eligibility).
references/rate-limiting-and-error-handling.md — Reusable helpers for rate
limiting, retries with exponential backoff, and result caching.
PharmDOG Tool
PharmDOG (formerly DDRx) is ClinPGx's clinical decision support tool for
interpreting pharmacogenomic test results. Features: phenoconversion calculator
(adjusts phenotype for drug-drug interactions affecting CYP2D6), custom genotype
input, QR-code report sharing, selectable guidance sources (CPIC, DPWG, FDA), and
multi-drug analysis. Access:
https://www.clinpgx.org/pharmacogenomic-decision-support
Important Notes
Data sources — ClinPGx consolidates PharmGKB (now part of ClinPGx), CPIC,
PharmCAT, DPWG, and FDA/EMA labels. As of July 2025, all PharmGKB URLs redirect
to corresponding ClinPGx pages.
Clinical considerations — Always check evidence strength before clinical
application; allele frequencies vary significantly across populations; account
for phenoconversion (drug-drug interactions) and multi-gene effects; non-genetic
factors (age, organ function) also affect response; not all clinically relevant
alleles are detected by all assays.
Data updates / API stability — ClinPGx updates continuously; check
publication dates and the ClinPGx Blog (https://blog.clinpgx.org/). API endpoints
are relatively stable but may change during development — pin versions and test
in development before production.
Additional Resources
1---2name: alterlab-clinpgx3description: Access ClinPGx pharmacogenomics data (the successor to PharmGKB) to query gene-drug interactions, CPIC/DPWG dosing guidelines, drug labels, and pharmacogene records. Use when interpreting pharmacogenes (CYP2D6, CYP2C19, TPMT, DPYD, SLCO1B1), looking up genotype-guided drug dosing, checking PGx drug-safety associations (e.g. HLA-B*57:01 and abacavir), or supporting precision medicine and clinical pharmacogenomics decisions. For star-allele definitions/frequencies see PharmVar; for germline/somatic variant pathogenicity see alterlab-clinvar. Part of the AlterLab Academic Skills suite.4license: MIT5---67# ClinPGx Database89## Overview1011ClinPGx (Clinical Pharmacogenomics Database) is a comprehensive resource for12clinical pharmacogenomics, the successor to PharmGKB. It consolidates data from13PharmGKB, CPIC, and PharmCAT, providing curated information on how genetic14variation affects medication response. Access gene-drug pairs, clinical15guidelines, allele functions, and drug labels for precision medicine.1617## When to Use This Skill1819Use this skill for:2021- **Gene-drug interactions** — how variants affect drug metabolism, efficacy, or toxicity22- **CPIC guidelines** — evidence-based clinical practice guidelines for pharmacogenetics23- **Allele information** — allele function, frequency, and phenotype data24- **Drug labels** — FDA and other regulatory pharmacogenomic labeling25- **Pharmacogenomic annotations** — curated literature on gene-drug-disease relationships26- **Clinical decision support** — PharmDOG for phenoconversion and custom genotype interpretation27- **Precision medicine / personalized dosing** — genotype-guided dosing recommendations28- **Drug metabolism** — CYP450 and other pharmacogene functions29- **Adverse drug reactions** — genetic risk factors for drug toxicity3031## Setup and Access Essentials3233Only `requests` is needed. Run the helper script (or any snippet) with an34ephemeral dependency — no venv to manage:3536```bash37uv run --with requests python scripts/query_clinpgx.py38# or, inside an existing project venv: uv pip install requests39```4041Base URL: `https://api.clinpgx.org/v1/data/`4243- **Resource addressing**: ClinPGx resources are addressed by ClinPGx accession44 IDs in the path (e.g. gene CYP2D6 = `PA128`, CYP2C9 = `PA126`), **not** by gene45 symbols or rsIDs. To resolve a symbol or rsID, query the collection endpoint46 with parameters (e.g. `GET /v1/data/gene?symbol=CYP2D6`,47 `GET /v1/data/variant?symbol=rs4244285`) and read the accession ID from the48 response.49- **Response envelope** (verified): every response is a JSON object50 `{"status": "success"|"fail", "data": [...]}` — the payload is **never** a bare51 list. Read results from `response.json()["data"]`; on `status == "fail"`,52 `data` is `{"errors": [...]}` (e.g. "No results matching criteria").53- **Query-param convention** (verified): genes filter on `relatedGenes.symbol`54 (the `.name` form fails), while chemicals/drugs filter on55 `relatedChemicals.name` — `relatedChemicals.symbol` silently returns56 `status: "fail"` with zero results. The `gene` collection takes `?symbol=`, the57 `chemical` collection takes `?name=`, and `variant` accepts `?symbol=`/`?name=`.58- **Rate limits**: 2 requests per second maximum; excessive requests return HTTP59 429. Implement a ~500ms delay between requests.60- **Authentication**: Not required for basic access.61- **Data license**: Creative Commons Attribution-ShareAlike 4.0 International.62- For substantial API use, notify the ClinPGx team at **api@clinpgx.org**.6364## Core Workflow65661. **Resolve identifiers** — Convert gene symbols / rsIDs to ClinPGx accession67 IDs via collection endpoints with `symbol=` parameters.682. **Query the relevant resource** — `gene`, `chemical`, `guidelineAnnotation`,69 `summaryAnnotation`, `variantAnnotation`, `variant`, `label`, or `pathway`.70 There is no `/allele` resource — use **PharmVar** (https://www.pharmvar.org/)71 for star-allele definitions and population frequencies.723. **Derive gene-drug relationships** — From guideline annotations73 (`relatedGenes.symbol` for genes, `relatedChemicals.name` for drugs), or the74 `/report/pair/{firstObjId}/{secondObjId}/{resultType}` endpoint.754. **Filter by evidence level** — Prefer levels 1A/1B/2A for clinical use;76 confirm field names against the live OpenAPI spec.775. **Respect rate limits** — Throttle, retry on 429 with backoff, and cache.7879For ready-made functions with rate limiting and error handling, see80`scripts/query_clinpgx.py`.8182## Routing Guidance8384- **Need the exact code for a resource (gene, chemical, gene-drug pair, CPIC85 guideline, allele/PharmVar, variant, clinical annotation, label, pathway)?**86 Read `references/endpoints-and-capabilities.md`.87- **Doing an end-to-end task (clinical decision support, gene-panel analysis,88 drug-safety assessment, population pharmacogenomics, literature review) or a89 common use case?** Read `references/query-workflows.md`.90- **Need robust API plumbing (rate limiting, retries, caching)?** Read91 `references/rate-limiting-and-error-handling.md`.92- **Need full endpoint/parameter/schema details?** Read93 `references/api_reference.md`.9495## References9697- `references/api_reference.md` — Complete endpoint listing, request/response98 formats, filter operators, data schemas, rate-limit details, and99 troubleshooting.100- `references/endpoints-and-capabilities.md` — Worked code for all nine101 capability areas (gene, drug/chemical, gene-drug pair, CPIC guidelines,102 allele/PharmVar, variant, clinical annotations, drug labels, pathways),103 including key pharmacogenes and evidence-level definitions.104- `references/query-workflows.md` — Five end-to-end workflows (decision support,105 gene panel, drug safety, population pharmacogenomics, literature review) plus106 common use cases (pre-emptive testing, medication therapy management, trial107 eligibility).108- `references/rate-limiting-and-error-handling.md` — Reusable helpers for rate109 limiting, retries with exponential backoff, and result caching.110111## PharmDOG Tool112113PharmDOG (formerly DDRx) is ClinPGx's clinical decision support tool for114interpreting pharmacogenomic test results. Features: phenoconversion calculator115(adjusts phenotype for drug-drug interactions affecting CYP2D6), custom genotype116input, QR-code report sharing, selectable guidance sources (CPIC, DPWG, FDA), and117multi-drug analysis. Access:118https://www.clinpgx.org/pharmacogenomic-decision-support119120## Important Notes121122**Data sources** — ClinPGx consolidates PharmGKB (now part of ClinPGx), CPIC,123PharmCAT, DPWG, and FDA/EMA labels. As of July 2025, all PharmGKB URLs redirect124to corresponding ClinPGx pages.125126**Clinical considerations** — Always check evidence strength before clinical127application; allele frequencies vary significantly across populations; account128for phenoconversion (drug-drug interactions) and multi-gene effects; non-genetic129factors (age, organ function) also affect response; not all clinically relevant130alleles are detected by all assays.131132**Data updates / API stability** — ClinPGx updates continuously; check133publication dates and the ClinPGx Blog (https://blog.clinpgx.org/). API endpoints134are relatively stable but may change during development — pin versions and test135in development before production.136137## Additional Resources138139- **ClinPGx website**: https://www.clinpgx.org/140- **ClinPGx Blog**: https://blog.clinpgx.org/141- **API documentation**: https://api.clinpgx.org/142- **CPIC website**: https://cpicpgx.org/143- **PharmCAT**: https://pharmcat.clinpgx.org/144- **PharmVar** (star alleles): https://www.pharmvar.org/145- **ClinGen**: https://clinicalgenome.org/146- **Contact**: api@clinpgx.org (for substantial API use)