Skip to content

abeerpathela/GeneticGuardrail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧬 Genetic Guardrail

AI-Powered Pharmacogenomics Clinical Decision Support System (CDSS)


πŸš€ Overview

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.


❗ Problem Statement

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.


πŸ’‘ Solution

image

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

πŸ—οΈ Architecture

VCF File β†’ Agent 1 (Parser) β†’ Agent 2 (Risk Engine)
         β†’ Agent 3 (Clinical Explainer) β†’ Final Output
                         ↓
                       Cache

βš™οΈ Key Features

🧬 Genomic Analysis

  • Parses VCF files efficiently (streaming, large-file optimized)
  • Maps variants β†’ enzyme phenotypes

⚠️ Risk Engine (Clinical Logic)

  • Deterministic CPIC-based drug risk evaluation

  • Handles:

    • Poor / Intermediate / Normal / Ultra-Rapid metabolizers
    • Insufficient data scenarios

πŸ€– AI Clinical Explanation

  • Generates human-readable medical insights
  • Fallback-safe (Gemini optional, rule-based backup)

⚑ Performance & Reliability

  • Zero-failure architecture (no 500 errors)
  • Smart caching system (avoids recomputation)
  • Early exit optimization for fast processing
  • Timeout-safe AI handling

πŸ” Authentication & User System

  • Google OAuth-based authentication
  • User-specific data storage (secure and isolated)

πŸ“‚ File Management

  • Persistent VCF storage
  • File history retrieval per user
  • Reuse previous genomic data for analysis

πŸ§ͺ BioNeMo Integration (Simulation Layer)

  • Simulates drug interaction for unknown drugs
  • Fallback to AI explanation if unavailable

πŸ”Œ API Endpoints

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)

πŸ§ͺ Example Response

{
  "action": "Avoid",
  "risk_level": "High",
  "clinical_note": "CYP2D6 Poor Metabolizer detected. Codeine may be ineffective and unsafe.",
  "confidence": 0.95
}

πŸ› οΈ Tech Stack

  • Backend: FastAPI (Python)
  • Database: SQLite
  • Authentication: Google OAuth (Authlib)
  • AI Integration: Gemini (optional fallback)
  • Simulation: NVIDIA BioNeMo (optional)
  • Frontend: React / Flutter (in progress)

⚑ Getting Started

1️⃣ Clone Repository

git clone https://github.com/HackIndiaXYZ/hackindia-spark-7-north-region-code-sharks.git
cd backend

2️⃣ Install Dependencies

pip install -r requirements.txt

3️⃣ Setup Environment Variables

Create .env:

GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
BIONEMO_API_KEY=your_key

4️⃣ Run Server

uvicorn main:app --reload --port 8000

5️⃣ Access API Docs

http://127.0.0.1:8000/docs

πŸ“± Mobile Integration

The system can be accessed via:

  • Flutter mobile app (USB-connected testing supported)
  • React frontend dashboard (for visualization)

πŸ” Security

  • User-specific data isolation
  • Secure OAuth authentication
  • No exposure of sensitive genomic data

πŸš€ Future Scope

  • πŸ“Š Advanced visualization (risk charts, dashboards)
  • πŸ“„ Clinical PDF report generation
  • πŸ“± Full-feature mobile app
  • 🧠 Enhanced AI-driven decision support
  • 🧬 Multi-drug interaction analysis

πŸ† Why This Project Matters

Genetic Guardrail enables:

  • Safer prescriptions
  • Personalized medicine
  • Reduced adverse drug reactions
  • Data-driven clinical decisions

πŸ‘¨β€πŸ’» Team

Code Sharks 🦈 HackIndia Spark 7 – North Region


πŸ“Œ Final Note

This project demonstrates a scalable, reliable, and clinically relevant system that brings us closer to the future of precision medicine.


About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors