AI-powered web application that analyzes patient genetic data (VCF files) and predicts personalized drug risks using CPIC guidelines + Google Gemini AI explanations.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| Link | |
|---|---|
| π Live Demo | rift-pw-hackthon.vercel.app |
| π₯ LinkedIn Video | Watch Demo Video |
| π» GitHub Repo | aarav12e/RIFT_Pw_Hackthon |
Adverse drug reactions kill over 100,000 Americans annually. Many of these deaths are preventable through pharmacogenomic testing β analyzing how a patient's genetic variants affect drug metabolism.
PharmaGuard solves this by:
- Parsing real VCF (Variant Call Format) genetic files
- Identifying pharmacogenomic variants across 6 critical genes
- Predicting drug-specific risks: Safe, Adjust Dosage, Toxic, or Ineffective
- Generating clinically actionable AI explanations using Google Gemini
- Aligning all recommendations with CPIC (Clinical Pharmacogenomics Implementation Consortium) guidelines
User (Browser)
β
βΌ
React Frontend (Vercel)
β POST /analyze
β multipart/form-data: VCF file + drug names
βΌ
FastAPI Backend (Render)
β
βββ VCF Parser
β βββ Extracts rsIDs, gene annotations, genotypes
β
βββ CPIC Rules Engine
β βββ Maps variants β star alleles β phenotype (PM/IM/NM/RM/URM)
β
βββ Risk Predictor
β βββ Phenotype + Drug β Risk Label + Severity + Confidence
β
βββ Gemini AI (via HTTP)
βββ Generates clinical explanation with variant citations
β
βΌ
Structured JSON Response
β
βΌ
React UI β Color-coded results, confidence gauge, downloadable JSON
| Drug | Gene | Risk if Variant Present |
|---|---|---|
| CODEINE | CYP2D6 | Respiratory depression (URM) / No effect (PM) |
| WARFARIN | CYP2C9 | Dangerous bleeding risk (PM) |
| CLOPIDOGREL | CYP2C19 | Heart attack risk β cannot activate prodrug (PM) |
| SIMVASTATIN | SLCO1B1 | Muscle damage / myopathy (PM) |
| AZATHIOPRINE | TPMT | Fatal bone marrow toxicity (PM) |
| FLUOROURACIL | DPYD | Life-threatening systemic toxicity (PM) |
| Code | Phenotype | Meaning |
|---|---|---|
| PM | Poor Metabolizer | Drug builds up β risk of toxicity |
| IM | Intermediate Metabolizer | Reduced drug processing |
| NM | Normal Metabolizer | Standard dose is appropriate |
| RM | Rapid Metabolizer | Faster drug clearance |
| URM | Ultrarapid Metabolizer | Drug clears too fast β may be ineffective or toxic |
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite, Tailwind CSS |
| Backend | Python, FastAPI, Uvicorn |
| AI/LLM | Google Gemini 1.5 Flash (via direct HTTP) |
| VCF Parsing | Custom Python parser (VCFv4.2 compliant) |
| CPIC Rules | Hardcoded CPIC guideline mappings |
| Deployment | Vercel (frontend) + Render (backend) |
| Uptime | cron-job.org keep-alive ping every 10 minutes |
- Python 3.11+
- Node.js 18+
- Google Gemini API key (free at aistudio.google.com)
# Clone the repo
git clone https://github.com/aarav12e/RIFT_Pw_Hackthon.git
cd RIFT_Pw_Hackthon/backend
# Install dependencies
pip install -r requirements.txt
# Create environment file
cp .env.example .env
# Edit .env and add your GEMINI_API_KEY
# Start backend server
uvicorn main:app --reload --port 8000
# Runs at http://localhost:8000cd RIFT_Pw_Hackthon/frontend
# Install dependencies
npm install
# Create environment file
echo "VITE_API_URL=http://localhost:8000" > .env.local
# Start development server
npm run dev
# Runs at http://localhost:5173Backend .env.example:
GEMINI_API_KEY=your_gemini_api_key_here
Frontend .env.local:
VITE_API_URL=https://your-render-backend.onrender.com
Analyzes a VCF file for pharmacogenomic drug interactions.
Request: multipart/form-data
| Field | Type | Description |
|---|---|---|
vcf_file |
File | .vcf file, max 5MB |
drugs |
String | Comma-separated drug names e.g. CODEINE,WARFARIN |
Supported drugs: CODEINE, WARFARIN, CLOPIDOGREL, SIMVASTATIN, AZATHIOPRINE, FLUOROURACIL
Single drug response:
{
"patient_id": "PATIENT_001",
"drug": "CODEINE",
"timestamp": "2026-02-19T12:00:00Z",
"risk_assessment": {
"risk_label": "Toxic",
"confidence_score": 0.95,
"severity": "critical"
},
"pharmacogenomic_profile": {
"primary_gene": "CYP2D6",
"diplotype": "*4/*3",
"phenotype": "PM",
"detected_variants": [
{
"rsid": "rs3892097",
"star_allele": "*4",
"function_status": "no_function",
"genotype": "1|1"
}
]
},
"clinical_recommendation": {
"action": "Avoid codeine. Use alternative analgesic.",
"cpic_guideline": "CPIC Guideline for CODEINE and CYP2D6",
"mechanism": "CYP2D6 poor metabolizers cannot convert codeine to morphine."
},
"llm_generated_explanation": {
"summary": "...",
"mechanism_explanation": "...",
"patient_friendly": "...",
"clinical_significance": "...",
"monitoring_parameters": "...",
"alternative_drugs": "..."
},
"quality_metrics": {
"vcf_parsing_success": true,
"total_variants_in_vcf": 8,
"pharmacogenomic_variants_found": 2,
"processing_time_seconds": 3.2
}
}Multiple drugs response: Returns a JSON array of the above objects, one per drug.
{ "status": "healthy" }{
"drugs": ["CODEINE", "WARFARIN", "CLOPIDOGREL", "SIMVASTATIN", "AZATHIOPRINE", "FLUOROURACIL"],
"genes": ["CYP2D6", "CYP2C9", "CYP2C19", "SLCO1B1", "TPMT", "DPYD"]
}Located in the sample_vcf/ folder β use these to test all risk scenarios:
| File | Clinical Scenario | Drug | Expected Result |
|---|---|---|---|
test1_normal_metabolizer_SAFE.vcf |
β Normal β Reference Genotype | CODEINE | Safe Β· NM |
test4_CYP2C9_PM_WARFARIN_ADJUST.vcf |
WARFARIN | Adjust Dosage Β· High | |
test7_SLCO1B1_PM_SIMVASTATIN_TOXIC.vcf |
π΄ Simvastatin High Risk | SIMVASTATIN | Adjust Dosage Β· Moderate |
test6_DPYD_PM_FLUOROURACIL_CRITICAL.vcf |
β οΈ Fluorouracil Contraindicated | FLUOROURACIL | Toxic Β· Critical |
- Open rift-pw-hackthon.vercel.app
- Click "β οΈ Toxic β Fluorouracil Contraindicated" predefined scenario
- Click "Analyze 1 Drug β"
- See the critical red result with AI clinical explanation
- Click "β Download JSON" to verify RIFT schema compliance
| Scenario Button | Drug | Expected Result |
|---|---|---|
| β Normal β Reference Genotype | CODEINE | Safe Β· Normal Metabolizer |
| WARFARIN | Adjust Dosage Β· High Severity | |
| π΄ Risk β Simvastatin High Risk | SIMVASTATIN | Adjust Dosage Β· Moderate |
| β οΈ Toxic β Fluorouracil Contraindicated | FLUOROURACIL | Toxic Β· Critical Severity |
- Only 6 genes and 6 drugs supported (per RIFT specification)
- Phenotype prediction uses simplified diplotype logic β does not implement full CYP2D6 Activity Score method
- VCF parser handles standard VCFv4.2 format; exotic formats may need preprocessing
- LLM explanations require valid Gemini API key; falls back to rule-based text if API unavailable
- CYP2D6 copy number variations (gene duplications) not implemented
- Not validated for clinical use β research and educational purposes only
| Name | Role |
|---|---|
| Aarav Kumar | Team Lead Β· Full Stack + AI |
| Archana Kumari | Frontend Development |
| Tanya Kumari | Backend Development |
PharmaGuard is built for the RIFT 2026 Hackathon. It is intended for research and educational purposes only and is not validated for clinical diagnosis or treatment decisions. Always consult a qualified healthcare professional for medical advice.
Built with β€οΈ by Team BugByte for RIFT 2026 Hackathon β HealthTech / Pharmacogenomics Track
Hashtags: #RIFT2026 #PharmaGuard #Pharmacogenomics #AIinHealthcare








