{"slug":"alterlab-clinpgx","title":"alterlab-clinpgx","summary":"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","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-23T18:57:09.005651Z","repo":{"url":"https://github.com/AlterLab-IEU/AlterLab-Academic-Skills","stars":68,"forks":13,"license":"MIT","updatedAt":"2026-09-23T13:42:59Z"},"bodyHtml":"<hr>\n<h2>name: alterlab-clinpgx\ndescription: 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<em>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.\nlicense: MIT\nallowed-tools: Read WebFetch Bash(curl:</em>) Bash(python:*)\ncompatibility: Keyless ClinPGx (PharmGKB) API for basic access (no authentication required)\nmetadata:\nskill-author: AlterLab\nversion: \"1.0.1\"\nlast_updated: \"2026-09-23\"</h2>\n<h1>ClinPGx Database</h1>\n<h2>Overview</h2>\n<p>ClinPGx (Clinical Pharmacogenomics Database) is a comprehensive resource for\nclinical pharmacogenomics, the successor to PharmGKB. It consolidates data from\nPharmGKB, CPIC, and PharmCAT, providing curated information on how genetic\nvariation affects medication response. Access gene-drug pairs, clinical\nguidelines, allele functions, and drug labels for precision medicine.</p>\n<h2>When to Use This Skill</h2>\n<p>Use this skill for:</p>\n<ul>\n<li><strong>Gene-drug interactions</strong> — how variants affect drug metabolism, efficacy, or toxicity</li>\n<li><strong>CPIC guidelines</strong> — evidence-based clinical practice guidelines for pharmacogenetics</li>\n<li><strong>Allele information</strong> — allele function, frequency, and phenotype data</li>\n<li><strong>Drug labels</strong> — FDA and other regulatory pharmacogenomic labeling</li>\n<li><strong>Pharmacogenomic annotations</strong> — curated literature on gene-drug-disease relationships</li>\n<li><strong>Clinical decision support</strong> — PharmDOG for phenoconversion and custom genotype interpretation</li>\n<li><strong>Precision medicine / personalized dosing</strong> — genotype-guided dosing recommendations</li>\n<li><strong>Drug metabolism</strong> — CYP450 and other pharmacogene functions</li>\n<li><strong>Adverse drug reactions</strong> — genetic risk factors for drug toxicity</li>\n</ul>\n<h3>Does NOT Trigger</h3>\n<table>\n<thead>\n<tr>\n<th>Scenario</th>\n<th>Use Instead</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Germline/somatic variant pathogenicity or ClinVar review status</td>\n<td><code>alterlab-clinvar</code></td>\n</tr>\n<tr>\n<td>Population allele frequencies for a variant (gnomAD v4)</td>\n<td><code>alterlab-gnomad</code></td>\n</tr>\n<tr>\n<td>Drug–drug interactions or general pharmacology with no genetic component</td>\n<td><code>alterlab-drugbank</code></td>\n</tr>\n<tr>\n<td>FDA adverse-event reports, recalls, or full-text label search</td>\n<td><code>alterlab-fda</code></td>\n</tr>\n</tbody>\n</table>\n<h2>Setup and Access Essentials</h2>\n<p>Only <code>requests</code> is needed. Run the helper script (or any snippet) with an\nephemeral dependency — no venv to manage:</p>\n<pre><code>uv run --with requests python scripts/query_clinpgx.py\n# or, inside an existing project venv: uv pip install requests\n</code></pre>\n<p>Base URL: <code>https://api.clinpgx.org/v1/data/</code> — the legacy <code>api.pharmgkb.org</code> host was\nturned off on 2026-07-20, so older PharmGKB scripts must switch hostnames (paths are\nunchanged).</p>\n<ul>\n<li><strong>Resource addressing</strong>: ClinPGx resources are addressed by ClinPGx accession\nIDs in the path (e.g. gene CYP2D6 = <code>PA128</code>, CYP2C9 = <code>PA126</code>), <strong>not</strong> by gene\nsymbols or rsIDs. To resolve a symbol or rsID, query the collection endpoint\nwith parameters (e.g. <code>GET /v1/data/gene?symbol=CYP2D6</code>,\n<code>GET /v1/data/variant?symbol=rs4244285</code>) and read the accession ID from the\nresponse.</li>\n<li><strong>Response envelope</strong> (verified): every response is a JSON object\n<code>{\"status\": \"success\"|\"fail\", \"data\": [...]}</code> — the payload is <strong>never</strong> a bare\nlist. Read results from <code>response.json()[\"data\"]</code>; on <code>status == \"fail\"</code>,\n<code>data</code> is <code>{\"errors\": [...]}</code> (e.g. \"No results matching criteria\").</li>\n<li><strong>Query-param convention</strong> (verified): genes filter on <code>relatedGenes.symbol</code>\n(the <code>.name</code> form fails), while chemicals/drugs filter on\n<code>relatedChemicals.name</code> — <code>relatedChemicals.symbol</code> silently returns\n<code>status: \"fail\"</code> with zero results. The <code>gene</code> collection takes <code>?symbol=</code>, the\n<code>chemical</code> collection takes <code>?name=</code>, and <code>variant</code> accepts <code>?symbol=</code>/<code>?name=</code>.</li>\n<li><strong>Rate limits</strong>: 2 requests per second maximum; excessive requests return HTTP\n429. Implement a ~500ms delay between requests.</li>\n<li><strong>Authentication</strong>: Not required for basic access.</li>\n<li><strong>Data license</strong>: Creative Commons Attribution-ShareAlike 4.0 International.</li>\n<li>For substantial API use, notify the ClinPGx team at <strong>api@clinpgx.org</strong>.</li>\n</ul>\n<h2>Core Workflow</h2>\n<ol>\n<li><strong>Resolve identifiers</strong> — Convert gene symbols / rsIDs to ClinPGx accession\nIDs via collection endpoints with <code>symbol=</code> parameters.</li>\n<li><strong>Query the relevant resource</strong> — <code>gene</code>, <code>chemical</code>, <code>guidelineAnnotation</code>,\n<code>summaryAnnotation</code>, <code>variantAnnotation</code>, <code>variant</code>, <code>label</code>, or <code>pathway</code>.\nThere is no <code>/allele</code> resource — use <strong>PharmVar</strong> (<a href=\"https://www.pharmvar.org/\">https://www.pharmvar.org/</a>)\nfor star-allele definitions and population frequencies.</li>\n<li><strong>Derive gene-drug relationships</strong> — From guideline annotations\n(<code>relatedGenes.symbol</code> for genes, <code>relatedChemicals.name</code> for drugs), or the\n<code>/report/pair/{firstObjId}/{secondObjId}/{resultType}</code> endpoint.</li>\n<li><strong>Filter by evidence level</strong> — Prefer levels 1A/1B/2A for clinical use;\nconfirm field names against the live OpenAPI spec.</li>\n<li><strong>Respect rate limits</strong> — Throttle, retry on 429 with backoff, and cache.</li>\n</ol>\n<p>For ready-made functions with rate limiting and error handling, see\n<code>scripts/query_clinpgx.py</code>.</p>\n<h2>Routing Guidance</h2>\n<ul>\n<li><strong>Need the exact code for a resource (gene, chemical, gene-drug pair, CPIC\nguideline, allele/PharmVar, variant, clinical annotation, label, pathway)?</strong>\nRead <code>references/endpoints-and-capabilities.md</code>.</li>\n<li><strong>Doing an end-to-end task (clinical decision support, gene-panel analysis,\ndrug-safety assessment, population pharmacogenomics, literature review) or a\ncommon use case?</strong> Read <code>references/query-workflows.md</code>.</li>\n<li><strong>Need robust API plumbing (rate limiting, retries, caching)?</strong> Read\n<code>references/rate-limiting-and-error-handling.md</code>.</li>\n<li><strong>Need full endpoint/parameter/schema details?</strong> Read\n<code>references/api_reference.md</code>.</li>\n</ul>\n<h2>References</h2>\n<ul>\n<li><code>references/api_reference.md</code> — Complete endpoint listing, request/response\nformats, filter operators, data schemas, rate-limit details, and\ntroubleshooting.</li>\n<li><code>references/endpoints-and-capabilities.md</code> — Worked code for all nine\ncapability areas (gene, drug/chemical, gene-drug pair, CPIC guidelines,\nallele/PharmVar, variant, clinical annotations, drug labels, pathways),\nincluding key pharmacogenes and evidence-level definitions.</li>\n<li><code>references/query-workflows.md</code> — Five end-to-end workflows (decision support,\ngene panel, drug safety, population pharmacogenomics, literature review) plus\ncommon use cases (pre-emptive testing, medication therapy management, trial\neligibility).</li>\n<li><code>references/rate-limiting-and-error-handling.md</code> — Reusable helpers for rate\nlimiting, retries with exponential backoff, and result caching.</li>\n</ul>\n<h2>PharmDOG Tool</h2>\n<p>PharmDOG (formerly DDRx) is ClinPGx's clinical decision support tool for\ninterpreting pharmacogenomic test results. Features: phenoconversion calculator\n(adjusts phenotype for drug-drug interactions affecting CYP2D6), custom genotype\ninput, QR-code report sharing, selectable guidance sources (CPIC, DPWG, FDA), and\nmulti-drug analysis. Access:\n<a href=\"https://www.clinpgx.org/pharmacogenomic-decision-support\">https://www.clinpgx.org/pharmacogenomic-decision-support</a></p>\n<h2>Important Notes</h2>\n<p><strong>Data sources</strong> — ClinPGx consolidates PharmGKB (now part of ClinPGx), CPIC,\nPharmCAT, DPWG, and FDA/EMA labels. As of July 2025, all PharmGKB URLs redirect\nto corresponding ClinPGx pages.</p>\n<p><strong>Clinical considerations</strong> — Always check evidence strength before clinical\napplication; allele frequencies vary significantly across populations; account\nfor phenoconversion (drug-drug interactions) and multi-gene effects; non-genetic\nfactors (age, organ function) also affect response; not all clinically relevant\nalleles are detected by all assays.</p>\n<p><strong>Data updates / API stability</strong> — ClinPGx updates continuously; check\npublication dates and the ClinPGx Blog (<a href=\"https://blog.clinpgx.org/\">https://blog.clinpgx.org/</a>). API endpoints\nare relatively stable but may change during development — pin versions and test\nin development before production.</p>\n<h2>Additional Resources</h2>\n<ul>\n<li><strong>ClinPGx website</strong>: <a href=\"https://www.clinpgx.org/\">https://www.clinpgx.org/</a></li>\n<li><strong>ClinPGx Blog</strong>: <a href=\"https://blog.clinpgx.org/\">https://blog.clinpgx.org/</a></li>\n<li><strong>API documentation</strong>: <a href=\"https://api.clinpgx.org/\">https://api.clinpgx.org/</a></li>\n<li><strong>CPIC website</strong>: <a href=\"https://cpicpgx.org/\">https://cpicpgx.org/</a></li>\n<li><strong>PharmCAT</strong>: <a href=\"https://pharmcat.clinpgx.org/\">https://pharmcat.clinpgx.org/</a></li>\n<li><strong>PharmVar</strong> (star alleles): <a href=\"https://www.pharmvar.org/\">https://www.pharmvar.org/</a></li>\n<li><strong>ClinGen</strong>: <a href=\"https://clinicalgenome.org/\">https://clinicalgenome.org/</a></li>\n<li><strong>Contact</strong>: api@clinpgx.org (for substantial API use)</li>\n</ul>\n","files":[{"path":"evals/evals.json","sizeBytes":4021,"isText":true},{"path":"references/api_reference.md","sizeBytes":19369,"isText":true},{"path":"references/endpoints-and-capabilities.md","sizeBytes":9156,"isText":true},{"path":"references/query-workflows.md","sizeBytes":6656,"isText":true},{"path":"references/rate-limiting-and-error-handling.md","sizeBytes":2875,"isText":true},{"path":"scripts/query_clinpgx.py","sizeBytes":17903,"isText":true},{"path":"SKILL.md","sizeBytes":8585,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-23T18:59:28.06331Z","sha256":"753CDF41BECA8C79ABCE1A2DDD6C0EC700787194A7D62A83B6535D3291B87612","sizeBytes":23887},"review":null,"source":{"repositoryUrl":"https://github.com/AlterLab-IEU/AlterLab-Academic-Skills","path":"skills/databases/alterlab-clinpgx","license":"MIT","commit":"e4836c08a20da195a11f30f203a8cf23ec30aa95","subtreeSha":"AD90EC68512C953B1ADB095590E6B7307900E1CE436A647F8493F28DA2CB58B2","lastSyncedAt":"2026-09-23T18:56:52.297238Z"},"reviewedAt":"2026-09-23T19:03:50.430241Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/AlterLab-IEU/AlterLab-Academic-Skills/tree/main/skills/databases/alterlab-clinpgx"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install alterlab-ieu-alterlab-academic-skills@llmmart"},{"target":"git","command":"git clone https://github.com/AlterLab-IEU/AlterLab-Academic-Skills.git"}]}