Home / Market / clinpgx database

clinpgx database

Access ClinPGx pharmacogenomics data (successor to PharmGKB). Query gene-drug interactions, CPIC guidelines, allele functions, for precision medicine and genotype-guided dosing decisions.

skill★ 347630 dlgithubMITInstall in CosmosUpstream Source

Documentation & Preview

--- name: clinpgx-database description: "Access ClinPGx pharmacogenomics data (successor to PharmGKB). Query gene-drug interactions, CPIC guidelines, allele functions, for precision medicine and genotype-guided dosing decisions."

---

ClinPGx Database

Overview

ClinPGx (Clinical Pharmacogenomics Database) is a comprehensive resource for clinical pharmacogenomics information, 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 applications.

When to Use This Skill

This skill should be used when:

Installation and Setup

Python API Access

The ClinPGx REST API provides programmatic access to all database resources. Basic setup:

uv pip install requests

API Endpoint

BASE_URL = "https://api.clinpgx.org/v1/"

Rate Limits:

Authentication: Not required for basic access

Data License: Creative Commons Attribution-ShareAlike 4.0 International License

For substantial API use, notify the ClinPGx team at api@clinpgx.org

Core Capabilities

1. Gene Queries

Retrieve gene information including function, clinical annotations, and pharmacogenomic significance:

import requests

# Get gene details
response = requests.get("https://api.clinpgx.org/v1/gene/CYP2D6")
gene_data = response.json()

# Search for genes by name
response = requests.get("https://api.clinpgx.org/v1/gene",
                       params={"q": "CYP"})
genes = response.json()

Key pharmacogenes:

2. Drug and Chemical Queries

Retrieve drug information including pharmacogenomic annotations and mechanisms:

# Get drug details
response = requests.get("https://api.clinpgx.org/v1/chemical/PA448515")  # Warfarin
drug_data = response.json()

# Search drugs by name
response = requests.get("https://api.clinpgx.org/v1/chemical",
                       params={"name": "warfarin"})
drugs = response.json()

Drug categories with pharmacogenomic significance:

3. Gene-Drug Pair Queries

Access curated gene-drug relationships with clinical annotations:

# Get gene-drug pair information
response = requests.get("https://api.clinpgx.org/v1/geneDrugPair",
                       params={"gene": "CYP2D6", "drug": "codeine"})
pair_data = response.json()

# Get all pairs for a gene
response = requests.get("https://api.clinpgx.org/v1/geneDrugPair",
                       params={"gene": "CYP2C19"})
all_pairs = response.json()

Clinical annotation sources:

4. CPIC Guidelines

Access evidence-based clinical practice guidelines:

# Get CPIC guideline
response = requests.get("https://api.clinpgx.org/v1/guideline/PA166104939")
guideline = response.json()

# List all CPIC guidelines
response = requests.get("https://api.clinpgx.org/v1/guideline",
                       params={"source": "CPIC"})
guidelines = response.json()

CPIC guideline components:

Example guidelines:

5. Allele and Variant Information

Query allele function and frequency data:

# Get allele information
response = requests.get("https://api.clinpgx.org/v1/allele/CYP2D6*4")
allele_data = response.json()

# Get all alleles for a gene
response = requests.get("https://api.clinpgx.org/v1/allele",
                       params={"gene": "CYP2D6"})
alleles = response.json()

Allele information includes:

Phenotype categories:

6. Variant Annotations

Access clinical annotations for specific genetic variants:

# Get variant information
response = requests.get("https://api.clinpgx.org/v1/variant/rs4244285")
variant_data = response.json()

# Search variants by position (if supported)
response = requests.get("https://api.clinpgx.org/v1/variant",
                       params={"chromosome": "10", "position": "94781859"})
variants = response.json()

Variant data includes:

7. Clinical Annotations

Retrieve curated literature annotations (formerly PharmGKB clinical annotations):

# Get clinical annotations
response = requests.get("https://api.clinpgx.org/v1/clinicalAnnotation",
                       params={"gene": "CYP2D6"})
annotations = response.json()

# Filter by evidence level
response = requests.get("https://api.clinpgx.org/v1/clinicalAnnotation",
                       params={"evidenceLevel": "1A"})
high_evidence = response.json()

Evidence levels (from highest to lowest):

8. Drug Labels

Access pharmacogenomic information from drug labels:

# Get drug labels with PGx information
response = requests.get("https://api.clinpgx.org/v1/drugLabel",
                       params={"drug": "warfarin"})
labels = response.json()

# Filter by regulatory source
response = requests.get("https://api.clinpgx.org/v1/drugLabel",
                       params={"source": "FDA"})
fda_labels = response.json()

Label information includes:

9. Pathways

Explore pharmacokinetic and pharmacodynamic pathways:

# Get pathway information
response = requests.get("https://api.clinpgx.org/v1/pathway/PA146123006")  # Warfarin pathway
pathway_data = response.json()

# Search pathways by drug
response = requests.get("https://api.clinpgx.org/v1/pathway",
                       params={"drug": "warfarin"})
pathways = response.json()

Pathway diagrams show:

Query Workflow

Workflow 1: Clinical Decision Support for Drug Prescription

  1. Identify patient genotype for relevant pharmacogenes:
   # Example: Patient is CYP2C19 *1/*2 (intermediate metabolizer)
   response = requests.get("https://api.clinpgx.org/v1/allele/CYP2C19*2")
   allele_function = response.json()
  1. Query gene-drug pairs for medication of interest:
   response = requests.get("https://api.clinpgx.org/v1/geneDrugPair",
                          params={"gene": "CYP2C19", "drug": "clopidogrel"})
   pair_info = response.json()
  1. Retrieve CPIC guideline for dosing recommendations:
   response = requests.get("https://api.clinpgx.org/v1/guideline",
                          params={"gene": "CYP2C19", "drug": "clopidogrel"})
   guideline = response.json()
   # Recommendation: Alternative antiplatelet therapy for IM/PM
  1. Check drug label for regulatory guidance:
   response = requests.get("https://api.clinpgx.org/v1/drugLabel",
                          params={"drug": "clopidogrel"})
   label = response.json()

Workflow 2: Gene Panel Analysis

  1. Get list of pharmacogenes in clinical panel:
   pgx_panel = ["CYP2C19", "CYP2D6", "CYP2C9", "TPMT", "DPYD", "SLCO1B1"]
  1. For each gene, retrieve all drug interactions:
   all_interactions = {}
   for gene in pgx_panel:
       response = requests.get("https://api.clinpgx.org/v1/geneDrugPair",
                              params={"gene": gene})
       all_interactions[gene] = response.json()
  1. Filter for CPIC guideline-level evidence:
   for gene, pairs in all_interactions.items():
       for pair in pairs:
           if pair.get('cpicLevel'):  # Has CPIC guideline
               print(f"{gene} - {pair['drug']}: {pair['cpicLevel']}")
  1. Generate patient report with actionable pharmacogenomic findings.

Workflow 3: Drug Safety Assessment

  1. Query drug for PGx associations:
   response = requests.get("https://api.clinpgx.org/v1/chemical",
                          params={"name": "abacavir"})
   drug_id = response.json()[0]['id']
  1. Get clinical annotations:
   response = requests.get("https://api.clinpgx.org/v1/clinicalAnnotation",
                          params={"drug": drug_id})
   annotations = response.json()
  1. Check for HLA associations and toxicity risk:
   for annotation in annotations:
       if 'HLA' in annotation.get('genes', []):
           print(f"Toxicity risk: {annotation['phenotype']}")
           print(f"Evidence level: {annotation['evidenceLevel']}")
  1. Retrieve screening recommendations from guidelines and labels.

Workflow 4: Research Analysis - Population Pharmacogenomics

  1. Get allele frequencies for population comparison:
   response = requests.get("https://