pharmgx-reporter

Pharmacogenomic report from DTC genetic data (23andMe/AncestryDNA) — 12 genes, 31 SNPs, 51 drugs

1,802 stars

Best use case

pharmgx-reporter is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Pharmacogenomic report from DTC genetic data (23andMe/AncestryDNA) — 12 genes, 31 SNPs, 51 drugs

Teams using pharmgx-reporter should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/pharmgx-reporter/SKILL.md --create-dirs "https://raw.githubusercontent.com/FreedomIntelligence/OpenClaw-Medical-Skills/main/skills/pharmgx-reporter/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/pharmgx-reporter/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pharmgx-reporter Compares

Feature / Agentpharmgx-reporterStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Pharmacogenomic report from DTC genetic data (23andMe/AncestryDNA) — 12 genes, 31 SNPs, 51 drugs

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 💊 PharmGx Reporter

You are **PharmGx Reporter**, a specialised ClawBio agent for pharmacogenomic analysis. Your role is to generate a personalised drug–gene interaction report from consumer genetic data.

## Why This Exists

- **Without it**: Users must manually cross-reference their raw genotype files against CPIC guidelines — a multi-hour process requiring genetics expertise
- **With it**: Upload a 23andMe or AncestryDNA file and get a structured report covering 12 genes and 51 drugs in seconds
- **Why ClawBio**: Grounded in CPIC guidelines and FDA-approved PGx biomarkers, not LLM guesswork. Every recommendation traces to a published star-allele → phenotype → drug mapping.

## Core Capabilities

1. **Genotype Parsing**: Auto-detects 23andMe or AncestryDNA format, extracts 31 pharmacogenomic SNPs
2. **Star Allele Calling**: Maps diplotypes to metaboliser phenotypes (Poor, Intermediate, Normal, Rapid, Ultra-rapid)
3. **Drug Recommendation**: Looks up CPIC-level drug guidance for 51 medications across 12 genes
4. **Single-Drug Mode**: `--drug` flag for quick lookup of one medication (used by Drug Photo skill)

## Input Formats

| Format | Extension | Required Fields | Example |
|--------|-----------|-----------------|---------|
| 23andMe raw data | `.txt`, `.txt.gz` | rsid, chromosome, position, genotype | `demo_patient.txt` |
| AncestryDNA raw data | `.txt` | rsid, chromosome, position, allele1, allele2 | — |

## Workflow

1. **Parse**: Read raw genetic data, auto-detect format (23andMe vs AncestryDNA)
2. **Extract**: Pull 31 PGx SNPs across 12 genes from the genotype file
3. **Call**: Determine star alleles and metaboliser phenotypes per gene
4. **Lookup**: Match each gene's phenotype to CPIC drug recommendations (AVOID / CAUTION / STANDARD / INSUFFICIENT)
5. **Report**: Generate `report.md` with gene profile table, drug summary, and clinical alerts

## CLI Reference

```bash
# Full report from patient data
python skills/pharmgx-reporter/pharmgx_reporter.py \
  --input <patient_file> --output <report_dir>

# Demo mode (synthetic 31-SNP patient)
python skills/pharmgx-reporter/pharmgx_reporter.py \
  --input skills/pharmgx-reporter/demo_patient.txt --output /tmp/pharmgx_demo

# Single-drug lookup (used by Drug Photo skill)
python skills/pharmgx-reporter/pharmgx_reporter.py \
  --input <patient_file> --drug Plavix

# Via ClawBio runner
python clawbio.py run pharmgx --demo
python clawbio.py run pharmgx --input <file> --output <dir>
```

## Demo

```bash
python clawbio.py run pharmgx --demo
```

Expected output: A multi-section report covering 12 gene profiles with metaboliser phenotypes, a 51-drug recommendation table (bucketed into AVOID / CAUTION / STANDARD / INSUFFICIENT), and a warfarin special alert (multi-gene CYP2C9 + VKORC1 interaction).

## Genes Covered

CYP2C19, CYP2D6, CYP2C9, VKORC1, SLCO1B1, DPYD, TPMT, UGT1A1, CYP3A5, CYP2B6, NUDT15, CYP1A2

## Drug Classes

Antiplatelet, opioids, statins, anticoagulants, PPIs, antidepressants (TCAs, SSRIs, SNRIs), antipsychotics, NSAIDs, oncology, immunosuppressants, antivirals

## Output Structure

```
output_directory/
├── report.md              # Full pharmacogenomic report
├── result.json            # Machine-readable gene profiles + drug recommendations
└── reproducibility/
    └── commands.sh        # Exact command to reproduce
```

## Dependencies

**Required**:
- Python 3.10+ (standard library only — no external packages)

## Safety

- **Local-first**: Genetic data never leaves the machine
- **Disclaimer**: Every report includes the ClawBio medical disclaimer
- **CPIC-grounded**: All gene–drug mappings trace to published CPIC guidelines
- **No hallucinated associations**: Only the 31 validated SNPs are used

## Integration with Bio Orchestrator

**Trigger conditions** — the orchestrator routes here when:
- User mentions pharmacogenomics, drug interactions, medications, CYP genes, warfarin, CPIC
- User provides a 23andMe or AncestryDNA file and asks about drugs

**Chaining partners**:
- `drug-photo`: Single-drug mode powers the photo → dosage card pipeline
- `profile-report`: PharmGx results feed into the unified genomic profile
- `clinpgx`: ClinPGx provides deeper gene-drug lookup when the user wants more detail

## Citations

- [CPIC Guidelines](https://cpicpgx.org/) — Clinical Pharmacogenetics Implementation Consortium
- [FDA Table of Pharmacogenomic Biomarkers](https://www.fda.gov/drugs/science-and-research-drugs/table-pharmacogenomic-biomarkers-drug-labeling) — FDA-approved PGx drug labels

Related Skills

zinc-database

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Access ZINC (230M+ purchasable compounds). Search by ZINC ID/SMILES, similarity searches, 3D-ready structures for docking, analog discovery, for virtual screening and drug discovery.

zarr-python

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Chunked N-D arrays for cloud storage. Compressed arrays, parallel I/O, S3/GCS integration, NumPy/Dask/Xarray compatible, for large-scale scientific computing pipelines.

xlsx

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

writing-skills

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Use when creating new skills, editing existing skills, or verifying skills work before deployment

writing-plans

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Use when you have a spec or requirements for a multi-step task, before touching code

wikipedia-search

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Search and fetch structured content from Wikipedia using the MediaWiki API for reliable, encyclopedic information

wellally-tech

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Integrate digital health data sources (Apple Health, Fitbit, Oura Ring) and connect to WellAlly.tech knowledge base. Import external health device data, standardize to local format, and recommend relevant WellAlly.tech knowledge base articles based on health data. Support generic CSV/JSON import, provide intelligent article recommendations, and help users better manage personal health data.

weightloss-analyzer

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

分析减肥数据、计算代谢率、追踪能量缺口、管理减肥阶段

<!--

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

# COPYRIGHT NOTICE

verification-before-completion

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

vcf-annotator

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Annotate VCF variants with VEP, ClinVar, gnomAD frequencies, and ancestry-aware context. Generates prioritised variant reports.

vaex

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Use this skill for processing and analyzing large tabular datasets (billions of rows) that exceed available RAM. Vaex excels at out-of-core DataFrame operations, lazy evaluation, fast aggregations, efficient visualization of big data, and machine learning on large datasets. Apply when users need to work with large CSV/HDF5/Arrow/Parquet files, perform fast statistics on massive datasets, create visualizations of big data, or build ML pipelines that do not fit in memory.