Inspiration

Many common medicines are processed by a handful of liver enzymes, and a patient’s genes can make those enzymes work too slowly or too fast. A second drug can block the same enzyme, so a genetically normal patient behaves like a poor metabolizer. Clinicians have published guidelines for these gene–drug combinations, but they sit in long documents that are hard to check during a busy medication review. We wanted a rule-based deterministic tool that brings the right guideline text to the surface for a specific patient and medication list.

What it does

Nociva has three parts.

Medication review: Checks a patient’s pharmacogenetics results (liver enzymes such as CYP2D6, CYP2C19, CYP2C9, CYP3A5) and medication list against 250,000+ published guideline records from CPIC, DPWG and other bodies, curated by ClinPGx. It returns exactly one of three verdicts: Association found, No documented association, or Insufficient evidence. Every finding quotes the guideline text word for word, with its source, version and date. It never treats an untested gene as normal, and it never presents “no documented association” as a safety finding. It also flags gene–drug–drug cases where one medication is on a demo list of enzyme inhibitors, and links related PubMed literature.

Molecular Explorer (experimental): It takes a molecule’s structure as a SMILES string, predicts whether it inhibits the liver enzymes using a machine-learning model, and shows the five most similar known compounds so the prediction can be checked against real data. It is kept separate from the medication review and never changes a verdict.

Pharmacokinetic Simulator: It plots how a hypothetical drop in drug clearance changes predicted blood concentration over 24 hours. It reports peak concentration, time to peak, total exposure (AUC) and half-life, and optional Monte Carlo bands show parameter variability.

How we built it

Frontend: React, TypeScript, Vite and Tailwind. Every API response is checked against a zod schema, so a mismatch between frontend and backend shows an error rather than wrong data. Charts use Recharts.
Backend: FastAPI in Python. The review engine reads from a Supabase (Postgres) database through strictly read-only queries. A guard refuses to start with any key that has write access.
Review engine: deterministic rules with no scoring and no generated advice. It matches exact drug names against the guidelines, matches the patient’s phenotype against the guideline wording, and quotes the guideline text as published.
Machine learning: a scikit-learn Random Forest trained on the public TDC CYP2D6_Veith dataset, using RDKit Morgan fingerprints and a scaffold split. On held-out data it scores an AUPRC of 0.704, against a 0.235 baseline, and an ROC-AUC of 0.852. Similar compounds are found by Tanimoto similarity over the training set.
Simulation: a one-compartment oral pharmacokinetic model solved in closed form and cross-checked against SciPy’s ODE solver, with NumPy Monte Carlo sampling using a fixed seed.
**Testing: **110 backend and 119 frontend tests, accessibility checks, and full end-to-end runs in a real browser.

Challenges we ran into

Team changes: two teammates became unavailable mid-hackathon, so we took over the backend and the simulation stream overnight and integrated everything into one repository with unrelated histories.
The original engine was unsafe: the first prototype treated any untested gene as normal, returned “SAFE” when it found nothing, and flagged any shared enzyme as a “collision”, even where the data said “not associated”. We rebuilt it around published guidelines and three honest verdicts.

Messy data: guideline summaries arrived as raw HTML, and the database stores highly complex relationships that were hard to understand. Drug names also needed exact matching, so that “dihydrocodeine” can’t match “codeine”.
Supporting the inhibitor claim: an inhibitor finding could cite guideline text about a different kind of inhibitor. We changed it to cite only guideline passages that actually discuss enzyme inhibition.
Security: we caught a database key with write access and replaced it with a read-only key, plus a guard that blocks privileged keys.

Accomplishments that we're proud of

A working live demo where every verdict traces back to a quoted, versioned guideline. Honest uncertainty: Nociva says “insufficient evidence” when a gene result is missing, rather than guessing.
A machine-learning model reported with real held-out metrics and similar-compound evidence, labelled experimental, never dressed up as clinical advice.
A simulator whose numbers we verified by hand and against an independent ODE solver. Everything runs locally on free, open-source tools.

What we learned

In clinical tools, “nothing found” and “safe” are very different statements, and the interface has to make that distinction impossible to miss.
Deterministic, traceable rules are the right fit for medication decisions. Machine learning works best as a clearly labelled research aid alongside them.
Splitting test data by molecular scaffold gives a more honest picture of how a chemistry model handles new compounds.
Typed contracts between frontend and backend saved us repeatedly during a fast, multi-person integration.

What's next for Nociva

Replace the demo inhibitor list with a curated, referenced source such as the FDA’s tables of drug interactions.
Cover more genes, including VKORC1 and CYP4F2 for warfarin, and genotype-to-phenotype translation following CPIC’s published tables.
Connect the simulator to validated drug-specific parameters where published models exist. Retrain the molecular model with more data and calibrated probabilities.
Get review from pharmacists and clinicians, and confirm the data licensing before any use beyond research.

Built With

Share this project:

Updates

Submission history