OpenParable
Skip to content
← Back to skills

Pharmgkb Clinpgx

Research
pharmgkb-clinpgx

Pharmgkb Clinpgx is an Agent Skill for research published in the BioTender-max/awesome-bio-agent-skills repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Query ClinPGx (PharmGKB) and CPIC for pharmacogenomics data. Use whenever the user asks about gene-drug interactions, pharmacogenomics clinical annotations, drug-metabolizing enzymes, CPIC guidelines, or variant-level PGx evidence for any gene symbol, drug name, rsID, or ClinPGx accession.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/BioTender-max/awesome-bio-agent-skills/blob/HEAD/skills/drugclaw/pharmgkb/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/pharmgkb-clinpgx, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

PharmGKB / ClinPGx Query Skill

Queries two complementary APIs:

  • ClinPGx API (api.clinpgx.org/v1) — gene, chemical, variant detail
  • CPIC API (api.cpicpgx.org/v1) — gene-drug pairs, CPIC guideline levels (PostgREST)

Auto-detects input entity type by pattern:

Input PatternDetected AsData Sources
PA128ClinPGx accessiongene or chemical detail + CPIC pairs
rs4244285dbSNP rsIDvariant lookup
CYP2D6gene symbol (uppercase, 2-15 chars)gene detail + CPIC pairs
anything elsedrug / free textchemical detail + CPIC pairs

API

FunctionInputReturns
search(entity)single entity stringdict with genes, chemicals, variants, cpic_pairs, related
search_batch(entities)list of entity stringsdict[str → search result]
summarize(result, entity)search result + labelcompact text (one line per hit)
to_json(result)search resultindented JSON string
search_gene(symbol)gene symbollist of gene dicts (ClinPGx)
search_drug(name)drug namelist of chemical dicts (ClinPGx)
search_variant(rsid)rsID stringlist of variant dicts (ClinPGx)
get_cpic_pairs_by_gene(symbol)gene symbollist of pair dicts (CPIC pair_view)
get_cpic_pairs_by_drug(name)drug namelist of pair dicts (CPIC pair_view)

Usage

See if __name__ == "__main__" block in 49_PHARMGKB_CLINPGX.py for runnable examples covering: gene symbol, drug name, rsID, ClinPGx accession, batch search, and JSON output.

Key Fields

Gene (ClinPGx): id, symbol, name, hasCpicGuideline

Chemical (ClinPGx): id, name, types

Variant (ClinPGx): id, symbol, genes, location

CPIC Pair (pair_view): genesymbol, drugname, cpiclevel (A/B/C/D), clinpgxlevel (evidence), pgxtesting, guidelinename

Data Sources

  • ClinPGx (Stanford / NIH) — https://www.clinpgx.org/ — REST JSON, no key, ≤2 req/s, CC BY-SA 4.0
  • CPIC API — https://api.cpicpgx.org/ — PostgREST, no key — gene-drug guideline pairs
  • Note: PharmGKB was subsumed by ClinPGx (July 2025). CPIC API remains at api.cpicpgx.org.