Methodology
Deterministic, explainable rule engine
PGxAI uses local TypeScript rule files for hackathon-demo decision support. No LLM makes medication decisions.
Safety disclaimer
PGxAI Clinical Engine v2 is an educational clinical decision-support prototype, not medical advice. It does not diagnose, prescribe, guarantee response, or replace clinician judgment. Outputs describe relative PGx compatibility in this prototype and require professional interpretation before any clinical action.
Canonical PGx engine
The final project uses one isolated TypeScript engine in lib/pgx-engine. UI components consume structured engine output; rules live in external JSON files.
Layer 1
Input normalizer
Each layer adds transparent score deltas, warnings, or confidence effects.
Layer 2
Genotype resolver
Each layer adds transparent score deltas, warnings, or confidence effects.
Layer 3
Phenoconversion
Each layer adds transparent score deltas, warnings, or confidence effects.
Layer 4
Pathway exposure model
Each layer adds transparent score deltas, warnings, or confidence effects.
Layer 5
PGx + combined rules
Each layer adds transparent score deltas, warnings, or confidence effects.
Layer 6
Clinical safety gates
Each layer adds transparent score deltas, warnings, or confidence effects.
Layer 7
Preference layer
Each layer adds transparent score deltas, warnings, or confidence effects.
Layer 8
Missing-data confidence
Each layer adds transparent score deltas, warnings, or confidence effects.
Layer 9
Explanation/counterfactuals
Each layer adds transparent score deltas, warnings, or confidence effects.
Final score = 0.30 × metabolism fit + 0.18 × inverse exposure risk + 0.14 × inverse efficacy risk + 0.14 × inverse interaction risk + 0.12 × clinical safety + 0.07 × preference fit + 0.05 × evidence confidence − missing-data penalty. Hard safety rules override scores.
Simple vs Detailed mode
Simple Search
Uses CYP2D6 and CYP2C19 star-allele diplotypes plus testing method. The app derives metabolizer phenotypes locally, then reports unknown medications and clinical risks as missing data.
Detailed Search
Adds current medications, prior failed antidepressants, adverse effects, QT/seizure/hepatic/renal/pregnancy/overdose/bipolar/bleeding risks, and preferences after genotype-to-phenotype interpretation.
Demo rule limitations
The MVP uses demo rules inspired by public pharmacogenomic guidance concepts. It is not a certified medical device.
- • Star-allele mapping and demo rules are simplified and not a validated clinical knowledge base.
- • Dosing, comorbidities, drug-drug interactions, ancestry-aware allele coverage, and label nuance are not fully modeled.
- • Missing data lower confidence, but cannot replace a professional medication review.
- • Recommendations use wording such as may influence, consider, and clinical review recommended.
Future production sources
A production pathway would ingest and version governed sources.