Genetic Guardrail is a production-ready backend system that leverages genomic data (VCF files) to provide personalized drug safety recommendations. It bridges the gap between genetic insights and clinical decision-making, enabling safer and more effective prescriptions.
Lack of integration between genomic data and clinical decision-making leads to suboptimal and risky medication choices, resulting in adverse drug reactions and ineffective treatments.
Genetic Guardrail analyzes patient genomic data to:
- Identify enzyme phenotypes (e.g., CYP2D6, CYP2C19)
- Assess drug-specific risks using clinical rules (CPIC-based)
- Provide clear, actionable recommendations
- Ensure reliability with zero-failure architecture
VCF File β Agent 1 (Parser) β Agent 2 (Risk Engine)
β Agent 3 (Clinical Explainer) β Final Output
β
Cache
- Parses VCF files efficiently (streaming, large-file optimized)
- Maps variants β enzyme phenotypes
-
Deterministic CPIC-based drug risk evaluation
-
Handles:
- Poor / Intermediate / Normal / Ultra-Rapid metabolizers
- Insufficient data scenarios
- Generates human-readable medical insights
- Fallback-safe (Gemini optional, rule-based backup)
- Zero-failure architecture (no 500 errors)
- Smart caching system (avoids recomputation)
- Early exit optimization for fast processing
- Timeout-safe AI handling
- Google OAuth-based authentication
- User-specific data storage (secure and isolated)
- Persistent VCF storage
- File history retrieval per user
- Reuse previous genomic data for analysis
- Simulates drug interaction for unknown drugs
- Fallback to AI explanation if unavailable
| Endpoint | Method | Description |
|---|---|---|
/auth/login |
GET | Google OAuth login |
/auth/callback |
GET | OAuth callback handler |
/files |
GET | Fetch userβs VCF history |
/check-prescription |
POST | Analyze drug risk (file or file_id) |
{
"action": "Avoid",
"risk_level": "High",
"clinical_note": "CYP2D6 Poor Metabolizer detected. Codeine may be ineffective and unsafe.",
"confidence": 0.95
}- Backend: FastAPI (Python)
- Database: SQLite
- Authentication: Google OAuth (Authlib)
- AI Integration: Gemini (optional fallback)
- Simulation: NVIDIA BioNeMo (optional)
- Frontend: React / Flutter (in progress)
git clone https://github.com/HackIndiaXYZ/hackindia-spark-7-north-region-code-sharks.git
cd backendpip install -r requirements.txtCreate .env:
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
BIONEMO_API_KEY=your_keyuvicorn main:app --reload --port 8000http://127.0.0.1:8000/docs
The system can be accessed via:
- Flutter mobile app (USB-connected testing supported)
- React frontend dashboard (for visualization)
- User-specific data isolation
- Secure OAuth authentication
- No exposure of sensitive genomic data
- π Advanced visualization (risk charts, dashboards)
- π Clinical PDF report generation
- π± Full-feature mobile app
- π§ Enhanced AI-driven decision support
- 𧬠Multi-drug interaction analysis
Genetic Guardrail enables:
- Safer prescriptions
- Personalized medicine
- Reduced adverse drug reactions
- Data-driven clinical decisions
Code Sharks π¦ HackIndia Spark 7 β North Region
This project demonstrates a scalable, reliable, and clinically relevant system that brings us closer to the future of precision medicine.