Alterlab Clinpgx logo

Alterlab Clinpgx

Community
AlterLab-IEU
alterlab-clinpgx

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.

Overview

PublisherAlterLab-IEU
RepositoryAlterLab-Academic-Skills
Skill namealterlab-clinpgx
Stars
84
Forks
16
Bundled files
6
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by AlterLab-IEU on GitHub. Read the source before you install it.

Installation

Install the Alterlab Clinpgx AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/AlterLab-IEU/AlterLab-Academic-Skills/tree/main/skills/databases/alterlab-clinpgx
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AlterLab-IEU/AlterLab-Academic-Skills.git /tmp/AlterLab-Academic-Skills
mkdir -p .claude/skills
cp -r /tmp/AlterLab-Academic-Skills/skills/databases/alterlab-clinpgx .claude/skills/alterlab-clinpgx
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Alterlab Clinpgx in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Alterlab Clinpgx on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Alterlab Clinpgx is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Does NOT Trigger

ScenarioUse Instead
Germline/somatic variant pathogenicity or ClinVar review statusalterlab-clinvar
Population allele frequencies for a variant (gnomAD v4)alterlab-gnomad
Drug–drug interactions or general pharmacology with no genetic componentalterlab-drugbank
FDA adverse-event reports, recalls, or full-text label searchalterlab-fda

Setup and Access Essentials

Only requests is needed. Run the helper script (or any snippet) with an ephemeral dependency — no venv to manage:

bash
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/ — the legacy api.pharmgkb.org host was turned off on 2026-07-20, so older PharmGKB scripts must switch hostnames (paths are unchanged).

  • 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 429. 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

  1. Resolve identifiers — Convert gene symbols / rsIDs to ClinPGx accession IDs via collection endpoints with symbol= parameters.
  2. 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.
  3. Derive gene-drug relationships — From guideline annotations (relatedGenes.symbol for genes, relatedChemicals.name for drugs), or the /report/pair/{firstObjId}/{secondObjId}/{resultType} endpoint.
  4. Filter by evidence level — Prefer levels 1A/1B/2A for clinical use; confirm field names against the live OpenAPI spec.
  5. 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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Alterlab Clinpgx AI skill do?

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.

Why use Alterlab Clinpgx on TypingMind?

Because you install it once and use it with any model. Alterlab Clinpgx is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Alterlab Clinpgx in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/AlterLab-IEU/AlterLab-Academic-Skills/tree/main/skills/databases/alterlab-clinpgx. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Alterlab Clinpgx?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Alterlab Clinpgx?

As many as you like. As long as a model supports skills, you can use Alterlab Clinpgx with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Alterlab Clinpgx AI skill free?

Yes. It is published on GitHub by AlterLab-IEU under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇