RIFT 2026 Hackathon | Pharmacogenomics / Explainable AI Track
Live Project demo https://coderbash-lucknow.onrender.com
| Resource | URL | | Live Application | -:YOUR_DEPLOYED_URL_HERE | | Demo Video (LinkedIn)| -: YOUR_LINKEDIN_VIDEO_URL_HERE | | GitHub Repository** | -: https://github.com/goldigd05/CoderBash_Lucknow |
PharmaGuard β AI-powered Pharmacogenomic Risk Prediction System
RIFT 2026 Hackathon | Pharmacogenomics / Explainable AI Track
Adverse drug reactions (ADRs) kill over 100,000 Americans annually. Many of these deaths are preventable through pharmacogenomic testing β analyzing how a patient's genetic variants affect how they metabolize drugs.
Current clinical workflows lack real-time, personalized, AI-powered decision support that can analyze a patient's VCF genetic data and instantly predict drug-specific risks with clinically actionable, CPIC-aligned recommendations.
PharmaGuard solves this by combining VCF parsing, pharmacogenomic knowledge, and Google Gemini LLM to deliver explainable, personalized drug risk predictions in seconds.
ββββββββββββββββββββββββββββββββββββββββββββββββ β FRONTEND (React + Vite) β β VCF Upload β Drug Input β Results Dashboard β βββββββββββββββββββββββ¬βββββββββββββββββββββββββ β POST /api/analyze βΌ ββββββββββββββββββββββββββββββββββββββββββββββββ β BACKEND (FastAPI + Python) β β β β VCF Parser β PGx Analyzer β Risk Assessor β β β β β Google Gemini LLM (XAI) β β β β β JSON Output (RIFT Schema) β ββββββββββββββββββββββββββββββββββββββββββββββββ
| Layer | Technology |
|---|---|
| Backend Framework | FastAPI (Python 3.11+) |
| LLM Integration | Google Gemini 2.0 Flash (Free API) |
| VCF Parsing | Custom pure-Python VCF v4.2 parser |
| PGx Knowledge Base | CPIC-curated variant database |
| Frontend | React + Vite |
| Deployment | Render.com |
| API Docs | FastAPI Swagger UI (/docs) |
| Gene | Drug | Clinical Risk (PM) |
|---|---|---|
| CYP2D6 | CODEINE | Ineffective β no morphine conversion |
| CYP2C19 | CLOPIDOGREL | Ineffective β no antiplatelet activation |
| CYP2C9 | WARFARIN | Toxic β severe bleeding risk |
| SLCO1B1 | SIMVASTATIN | Toxic β myopathy/rhabdomyolysis |
| TPMT | AZATHIOPRINE | Toxic (Critical) β fatal myelosuppression |
| DPYD | FLUOROURACIL | Toxic (Critical) β fatal chemo toxicity |
| Label | Color | Meaning |
|---|---|---|
| Safe | π’ Green | Standard dosing appropriate |
| Adjust Dosage | π‘ Yellow | Dose modification required |
| Toxic | π΄ Red | High toxicity risk at standard dose |
| Ineffective | π£ Purple | Drug will not work β use alternative |
| Unknown | βͺ Gray | Insufficient pharmacogenomic data |
- Python 3.11+
- Google Gemini API key (free at aistudio.google.com)
bash
git clone https://github.com/goldigd05/CoderBash_Lucknow.git cd CoderBash_Lucknow/Backend
python -m venv venv
venv\Scripts\activate
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn main:app --reload --host 0.0.0.0 --port 8000
API live at: http://localhost:8000
Swagger docs at: http://localhost:8000/docs
Main analysis endpoint
Request β multipart/form-data:
| Field | Type | Required | Description |
|---|---|---|---|
| vcf_file | File (.vcf) | β | Patient VCF file, max 5MB |
| drugs | String | β | Comma-separated drug names |
Example:
bash
curl -X POST http://localhost:8000/api/analyze
-F "vcf_file=@sample_vcf/test_patient_001.vcf"
-F "drugs=CODEINE,WARFARIN"
Response β Exact JSON Schema: json { "patient_id": "PATIENT_XXXXXX", "drug": "CODEINE", "timestamp": "2026-02-20T10:30:00Z", "risk_assessment": { "risk_label": "Safe", "confidence_score": 0.88, "severity": "none" }, "pharmacogenomic_profile": { "primary_gene": "CYP2D6", "diplotype": "*1/*1", "phenotype": "NM", "detected_variants": [] }, "clinical_recommendation": { "action": "Standard dosing", "dosing_guidance": "...", "cpic_recommendation": "...", "urgency": "ROUTINE", "cpic_guideline_applicable": true }, "llm_generated_explanation": { "summary": "...", "mechanism": "...", "variant_impact": "...", "clinical_context": "...", "monitoring_parameters": "...", "model_used": "gemini-2.0-flash" }, "quality_metrics": { "vcf_parsing_success": true, "variants_analyzed_for_drug": 0, "confidence_level": "HIGH" } }
Returns service status.
Returns all supported drugs and their genes.
Returns all supported pharmacogenomic genes.
Returns the full output JSON schema.
Test with Normal Patient (all Safe): bash
Test with Variant Patient: bash
PharmaGuard uses Google Gemini 2.0 Flash to generate explainable clinical explanations:
- Every explanation cites specific rsIDs from the patient's VCF
- 5 structured fields: summary, mechanism, variant impact, clinical context, monitoring
- Graceful fallback if API unavailable β structured template used
- Prompt engineered for clinician-grade pharmacogenomic language
- CPIC guideline citations included in every response
All risk assessments follow CPIC (Clinical Pharmacogenomics Implementation Consortium) guidelines:
- Strong/Moderate recommendation levels included
- Dosing guidance from validated CPIC tables
- Reference URLs to cpicpgx.org in every response
| Name | Role |
|---|---|
| Dilip jagriti goldi | |
| CoderBash tema name |
Backend/ βββ main.py β FastAPI entry point βββ requirements.txt βββ .env.example βββ sample_vcf/ β βββ test_patient_001.vcf β Variant patient test file β βββ test_patient_002_normal.vcf β Normal patient test file βββ src/ βββ parsers/ β βββ vcf_parser.py β VCF v4.2 parser βββ models/ β βββ pgx_knowledge.py β CPIC knowledge base βββ analyzers/ β βββ pgx_analyzer.py β Diplotype/phenotype engine β βββ risk_assessor.py β Risk lookup βββ services/ β βββ llm_service.py β Gemini API integration β βββ analysis_service.py β Orchestrator βββ routes/ βββ analysis.py β API endpoints βββ health.py β Health check
Deployed on Render.com
Deploy your own:
- Push code to GitHub
- render.com β New Web Service
- Build Command: pip install -r requirements.txt
- Start Command: uvicorn main:app --host 0.0.0.0 --port $PORT
- Environment Variable: GEMINI_API_KEY = your_key
- Deploy β get live URL!
Built with β€οΈ at RIFT 2026 Hackathon | May this algorithm save lives.