One drug. Two patients. One survives. The difference is in their DNA and PharmaGuard finds it.
RIFT 2026 Hackathon Β· HealthTech / Pharmacogenomics Track
Genetics determines how your body processes medication. The same prescription that cures one patient can be toxic or completely useless for another. Yet most clinical workflows still treat all patients the same way.
PharmaGuard changes that. Upload a patient's VCF (Variant Call Format) genomic file and a list of drugs. The system will:
- Parse the VCF and pull pharmacogenomic variants from 7 clinically critical genes
- Convert detected star alleles into diplotypes and phenotypes via CPIC guidelines
- Assign a risk label per drug:
SafeΒ·Adjust DosageΒ·ToxicΒ·Ineffective - Write plain-English clinical explanations using GPT-4 (with a rule-based fallback)
- Package everything into a structured JSON report ready for clinical action
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite, CSS Variables |
| Backend | FastAPI, Python 3.10+ |
| VCF Parsing | Custom Python parser (VCF v4.2) |
| Risk Engine | CPIC guideline lookup tables |
| AI Explanations | OpenAI GPT-4 (rule-based fallback included) |
| Deployment | Vercel (frontend) + Render (backend) |
| Gene | Drug | Risk if Impaired |
|---|---|---|
| CYP2D6 | Codeine | Poor metabolizer β Ineffective (no morphine conversion) |
| CYP2D6 | Atomoxetine | Poor metabolizer β Toxic (10Γ plasma accumulation) |
| CYP2C19 | Clopidogrel | Poor metabolizer β Ineffective + cardiovascular risk |
| CYP2C9 | Warfarin | Poor metabolizer β Toxic (bleeding risk) |
| SLCO1B1 | Simvastatin | *5 variant β Toxic (myopathy, rhabdomyolysis) |
| TPMT | Azathioprine | Poor metabolizer β Toxic (life-threatening myelosuppression) |
| DPYD | Fluorouracil | Poor metabolizer β Toxic (fatal multi-organ toxicity) |
| CYP2B6 | Efavirenz | Poor metabolizer β CNS toxicity risk |
Phenotypes supported: Poor Metabolizer Β· Intermediate Metabolizer Β· Normal Metabolizer Β· Rapid Metabolizer Β· Ultrarapid Metabolizer
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β React Frontend β
β FileUpload β DrugInput β Analyze β ResultsDisplay β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β HTTP POST /analyze (multipart)
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ
β FastAPI Backend β
β β
β ββββββββββββββββ βββββββββββββββ ββββββββββββββ β
β β VCF Parser ββ β Risk Engine ββ βLLM Explainerβ β
β ββββββββββββββββ βββββββββββββββ ββββββββββββββ β
β β
β Gene β Diplotype β Phenotype β Risk Label β JSON β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Data Flow:
VCF File
β Parse variants & filter by genotype (GT β 0/0)
β Extract star alleles per gene
β Infer diplotype
β Lookup phenotype (CPIC tables)
β Predict drug risk
β Generate LLM explanation
β Return structured JSON report
- Python 3.10+
- Node.js 18+
- npm or yarn
cd backend
pip install -r requirements.txt
# Start server
uvicorn main:app --reload --port 8000cd frontend
npm install
cp .env.example .env
npm run devFrontend runs at http://localhost:5173
Basic analysis via curl:
curl -X POST http://localhost:8000/analyze \
-F "vcf_file=@patient.vcf" \
-F "drugs=CODEINE,WARFARIN" \
-F "patient_id=PATIENT_001"Run the built-in sample demo:
curl -X POST http://localhost:8000/analyze/sample \
-F "drugs=FLUOROURACIL,AZATHIOPRINE"Expected VCF file format:
##fileformat=VCFv4.2
##INFO=<ID=GENE,Number=1,Type=String,Description="Gene symbol">
##INFO=<ID=STAR,Number=1,Type=String,Description="Star allele">
##INFO=<ID=RS,Number=1,Type=String,Description="dbSNP rsID">
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT SAMPLE
chr22 42522613 . C T . PASS GENE=CYP2D6;STAR=*4;RS=rs3892097 GT 1/1
Note: Only variants where the patient carries the alternate allele (GT β
0/0) are processed. Homozygous reference calls are filtered out automatically.
Submit a patient VCF file to receive pharmacogenomic drug risk results.
Request (multipart/form-data):
| Field | Type | Required | Description |
|---|---|---|---|
vcf_file |
File (.vcf) | β | Patient VCF file |
drugs |
String | β | Comma-separated drug names |
patient_id |
String | β | Optional patient identifier |
openai_api_key |
String | β | Optional key for GPT-4 explanations |
Response (JSON):
{
"patient_id": "001",
"drug": "SIMVASTATIN",
"timestamp": "2026-02-19T23:58:43.452749Z",
"risk_assessment": {
"risk_label": "Safe",
"confidence_score": 0.9,
"severity": "none"
},
"pharmacogenomic_profile": {
"primary_gene": "SLCO1B1",
"diplotype": "*1/*1",
"phenotype": "Normal Function",
"detected_variants": []
},
"clinical_recommendation": {
"recommendation": "Standard simvastatin dosing is appropriate. Normal SLCO1B1 function ensures adequate hepatic uptake and clearance. Prescribe desired starting dose per disease-specific guidelines (typically 20β40 mg/day). Routine CK monitoring not required.",
"cpic_recommendation": "Prescribe desired starting dose per guidelines.",
"requires_dose_adjustment": false,
"contraindicated": false
},
"llm_generated_explanation": {
"summary": "Patient carries the *1/*1 diplotype in SLCO1B1, resulting in Normal Function status. For SIMVASTATIN, this translates to a Safe risk assessment with none severity.",
"mechanism": "SLCO1B1 encodes a hepatic uptake transporter that controls SIMVASTATIN uptake into liver cells. The *1/*1 diplotype impairs this transporter, reducing SIMVASTATIN clearance and increasing systemic exposure with risk of moderate muscle toxicity.",
"clinical_implications": "This patient is expected to respond normally to standard SIMVASTATIN dosing. No pharmacogenomic-based dose adjustments are necessary.",
"monitoring": "Routine clinical monitoring per standard of care.",
"generated_by": "rule-based-fallback",
"generated_at": "2026-02-19T23:58:43.452734"
},
"quality_metrics": {
"vcf_parsing_success": true,
"total_variants_parsed": 1,
"genes_detected": ["CYP2D6"],
"primary_gene_found": false,
"explanation_source": "rule-based-fallback"
}
}Run a risk analysis using the built-in high-risk demo VCF β no file upload needed.
Returns the complete list of supported drug names.
- Push repository to GitHub
- Create a new Web Service on render.com
- Set root directory:
backend/ - Build command:
pip install -r requirements.txt - Start command:
uvicorn main:app --host 0.0.0.0 --port $PORT
- Import GitHub repo on vercel.com
- Set root directory:
frontend/ - Add environment variable:
VITE_API_URL=https://your-render-url.onrender.com - Deploy
- VCF files must include
GENE,STAR, andRStags in the INFO field - Complex structural variants and copy number variations are not fully supported
- Diplotype inference relies solely on star alleles detected in the VCF
- GPT-4 explanations require a valid OpenAI API key β rule-based fallback activates otherwise
| Name |
|---|
| Harshita S |
| H R Madalambika |
| Kirtisree S |
| Rakshitha U |
BNM Institute of Technology | ECE | Bengaluru
PharmaGuard β because the right drug for the average patient isn't always the right drug for your patient.


