01
HTML · from GitHub
PharmaGuard – Pharmacogenomic Risk Prediction System RIFT 2026 Hackathon submission (Pharmacogenomics / XAI Track) Predicting adverse drug reactions & treatment response using genetics + explainable AI.
Precision medicine algorithm developed for the RIFT 2026 Hackathon (Pharmacogenomics + Explainable AI Track).
WebGL · move your cursor
- HTML
// readme
FromtheREADME
02
🏗 Architecture Overview
PharmaGuard acts as a bridge between raw genomic data and actionable clinical insights. The architecture follows a seamless pipeline:
- Frontend Client: A lightweight, responsive interface built with Vanilla JS and TailwindCSS captures the user's target medications and VCF file.
- VCF Parser & Phenotype Engine: The FastAPI backend parses the raw VCF file, extracts clinically relevant variants (rsIDs, Star alleles), and computes the patient's diplotype and phenotype (e.g., Poor Metabolizer, Normal Metabolizer) based on established CPIC logic.
- Explainable AI Integration: The clinical parameters are sent to the Google Gemini API (
gemini-2.5-flash) to generate human-readable, biological mechanism explanations and clinical impact summaries. - Result Delivery: The processed risk assessment is returned to the frontend, displaying dynamic severity-coded alert cards with options to copy or export the clinical JSON report.
03
💻 Tech Stack
- Frontend: Vanilla JavaScript, HTML5, TailwindCSS (via CDN)
- Backend: Python 3.11, FastAPI, Uvicorn
- AI & LLM: Google Generative AI SDK (Gemini API)
- Deployment: Docker, Railway
- Data Processing: Custom VCF parser handling VCFv4.2 format
04
🛠 Installation Instructions
To run PharmaGuard locally, follow these steps:
-
Clone the repository
git clone [https://github.com/yourusername/pharmaguard.git](https://github.com/yourusername/pharmaguard.git) cd pharmaguard -
Set up a Virtual Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install Dependencies Install the required Python packages (including
fastapi,uvicorn,google-genai, andpython-multipart).pip install -r requirements.txt ``` -
Environment Variables Create a
.envfile in the root directory and add your Google Gemini API key:GEMINI_API_KEY=your_gemini_api_key_here ``` -
Run the Application
uvicorn app.main:app --reload
Navigate to http://127.0.0.1:8000/ to view the application.
05
Deployment Instructions
Option A: Railway (Recommended)
-
Push your repository to GitHub.
-
Log into Railway and click New Project -> Deploy from GitHub repo.
-
Select your PharmaGuard repository.
-
Go to the Variables tab in your Railway dashboard and add:
GEMINI_API_KEY:your_actual_api_key
-
Railway will automatically detect the Python environment and install dependencies from
requirements.txt. It will bind to the$PORTenvironment variable. -
Once built, Railway will provide a live HTTPS URL.
Option B: Docker
The project includes a ready-to-use Dockerfile based on python:3.11-slim.
-
Build the image:
docker build -t pharmaguard . -
Run the container (Exposes port 8000):
docker run -p 8000:8000 --env-file .env pharmaguard
06
📖 API Documentation
GET /health
Returns the operational status of the backend.
Response: {"status": "PharmaGuard backend running", "message": "Ready for VCF analysis"}
POST /validate-vcf
Validates the structural integrity of an uploaded VCF file.
- Payload:
multipart/form-data(file) - Response:
{"valid": true, "variant_count": <int>}
POST /full-analysis
Runs the complete pharmacogenomic pipeline against the selected drugs.
- Payload:
multipart/form-data(file, list of drugs e.g., "WARFARIN", "CODEINE") - Response: Returns a comprehensive JSON array containing the
risk_assessment,pharmacogenomic_profile,clinical_recommendation, and thellm_generated_explanationfor each targeted drug.
07
🧪 Usage Examples & Sample VCFs
-
Open the Analysis Workspace.
-
Select target medications from the list (e.g., Warfarin, Codeine, Fluorouracil).
-
Upload a patient VCF file. For testing, you can use the sample files provided in the repository:
test.vcf: A minimal mock file containing CYP2D6 (*4) and CYP2C9 (*3) mutations.PATIENT_002.vcf: Simulated patient with significant pathogenic variants.PATIENT_003.vcf: Simulated patient data representing a different diplotype profile.TC_P1_PATIENT_001_Normal.vcf: Simulated baseline normal patient.
-
Click Run Analysis to generate the AI-powered clinical report.
-
Use the Export JSON or Copy JSON buttons to extract the findings.
08
👥 Team Members
- Deepak K
- Pranav C
- Ruthvik N P