Skip to content
Back to skills

Pharmgx Reporter

ASecurity

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

  • 8 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 12, 2026
toolspythongobashgitapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned September 12, 2026

npx -y skills add stanfish06/skillquarium --skill pharmgx-reporter --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pharmgx Reporter?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pharmgx Reporter
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/stanfish06-pharmgx-reporter/badge)](https://www.skillsdirectory.com/skills/stanfish06-pharmgx-reporter)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pharmgx-reporter
description: Pharmacogenomic report from DTC genetic data (23andMe/AncestryDNA) — 12 genes, 31 SNPs, 51 drugs
license: MIT
metadata:
  version: 0.1.0
  author: Manuel Corpas
  tags:
  - pharmacogenomics
  - CPIC
  - DTC-genetics
  - precision-medicine
  openclaw:
    requires:
      bins:
      - python3
    always: false
    emoji: 💊
    homepage: https://github.com/ClawBio/ClawBio
    os:
    - darwin
    - linux
    trigger_keywords:
    - pharmacogenomics
    - drug interactions
    - 23andMe medications
    - CYP2D6
    - CYP2C19
    - warfarin
    - CPIC
---

# 💊 PharmGx Reporter

> [!note] Vault audit 2026-07-24 — USE-16
> Use this to generate an offline direct-to-consumer PGx report from a genotype/VCF (local script, CPIC gene-drug guidance); for live gene-drug lookups against the ClinPGx API use `clinpgx`, and for the image-triggered dosage card use `drug-photo`. Offline report generation vs live API vs image-triggered card is the distinguishing axis.

> [!note] Running these commands in this vault
> The CLI examples below are written for the upstream **ClawBio** repo layout, where skills live under `skills/` and a `clawbio.py` orchestrator exists. This flat skills vault has no `clawbio.py`: run a skill's script directly and drop the `skills/` prefix — e.g. `python pharmgx-reporter/pharmgx_reporter.py ...`. The `clawbio.py run <cmd>` multi-skill pipelines require the upstream ClawBio repo.

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

Files in this skill

  • INTENTS.json686 B
  • SKILL.md5.9 KB
  • api.py3.5 KB
  • demo_patient.txt2.4 KB
  • demo_report/report.md11.8 KB
  • examples/demo_report.html58.5 KB
  • pharmgx_reporter.py91.5 KB
  • tests/test_pharmgx.py27 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.