# Install uv (if not already installed)
# Windows PowerShell:
irm https://astral.sh/uv/install.ps1 | iex
# macOS/Linux:
# curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies with uv
uv pip install -r requirements.txt
# Or install project in editable mode
uv pip install -e .
# Create sample data
python scripts/download_data.py# Install dependencies
pip install -r requirements.txt
# Create sample data
python scripts/download_data.pySpeed Comparison:
- uv: ~5-10 seconds for all dependencies
- pip: ~2-5 minutes for all dependencies
# Show all available commands
.\make.ps1 help
# Install everything and run demo
.\make.ps1 quick-start
# Or run individual commands
.\make.ps1 install # Install with uv
.\make.ps1 data # Download data
.\make.ps1 demo # Run demo
.\make.ps1 api # Start API server# Show all available commands
make help
# Install everything and run demo
make quick-start
# Or run individual commands
make install # Install with uv
make data # Download data
make demo # Run demo
make api # Start API server# Run complete pipeline demo
python demo.py data/sample.vcfDemo includes:
- ✅ VCF parsing
- ✅ Variant annotation (Ensembl + gnomAD APIs)
- ✅ ML model training (nutrient deficiency predictor)
- ✅ Personalized health report generation
Expected output:
- Parsed variants table
- Annotated variants with gene symbols
- Nutrient deficiency risk scores (0-1)
- Personalized recommendations
# Start FastAPI server
python src/api/server.pyAccess:
- API Docs (Swagger): http://localhost:8000/docs
- OpenAPI Spec: http://localhost:8000/openapi.json
- ReDoc: http://localhost:8000/redoc
Example API calls:
# Health check
curl http://localhost:8000/
# Annotate single variant (MTHFR C677T)
curl -X POST http://localhost:8000/api/v1/annotate/variant \
-H "Content-Type: application/json" \
-d '{"chrom":"1","pos":11856378,"ref":"C","alt":"T"}'
# Upload VCF for nutrient predictions
curl -X POST http://localhost:8000/api/v1/predict/nutrients \
-F "vcf_file=@data/sample.vcf"
# Comprehensive analysis
curl -X POST "http://localhost:8000/api/v1/analyze/comprehensive?patient_id=SAMPLE001" \
-F "vcf_file=@data/sample.vcf"dirghayu/
├── src/
│ ├── data/ # VCF parsing, annotation
│ ├── models/ # ML models (nutrient predictor, etc.)
│ └── api/ # FastAPI server
├── scripts/ # Utility scripts
├── data/ # Downloaded datasets
├── models/ # Trained model checkpoints
├── demo.py # End-to-end demo
└── requirements.txt # Python dependencies
# Run with your VCF file
python demo.py /path/to/your/genome.vcf
# Or via API
curl -X POST http://localhost:8000/api/v1/analyze/comprehensive \
-F "vcf_file=@/path/to/your/genome.vcf" \
-F "patient_id=YOUR_ID"Note: Requires GCP account and cloud configuration
# src/cloud/deploy_gcp.py (NOT RUN LOCALLY)
from google.cloud import compute_v1
from google.cloud import storage
# This code won't run locally - requires GCP authentication
# Included for reference when deploying to cloud
def deploy_to_gcp():
"""Deploy to GCP with T4 GPU"""
# Instance configuration
instance_config = {
"name": "dirghayu-ml-server",
"machine_type": "n1-standard-4",
"zone": "asia-southeast1-c", # Your preferred zone
"gpus": [{
"type": "nvidia-tesla-t4",
"count": 1
}],
"disk": {
"size_gb": 100,
"image": "projects/ml-images/global/images/c0-deeplearning-common-gpu-v20230925-debian-11-py310"
}
}
# Deploy model to Cloud Storage
storage_client = storage.Client()
bucket = storage_client.bucket("dirghayu-models")
# Upload trained models
blob = bucket.blob("nutrient_predictor.pth")
blob.upload_from_filename("models/nutrient_predictor.pth")
print("✓ Deployed to GCP")
print(f" Instance: {instance_config['name']}")
print(f" Zone: {instance_config['zone']}")
print(f" GPU: NVIDIA Tesla T4")
# DON'T RUN THIS WITHOUT GCP CREDENTIALS
# deploy_to_gcp()-
GenomeIndia (10k genomes)
- URL: https://clingen.igib.res.in/genomeIndia/
- Requires registration - not auto-downloaded
-
1000 Genomes (Indian populations)
- Included: GIH, ITU, STU, BEB, PJL
- Auto-downloaded as proxy
-
gnomAD (population frequencies)
- API: https://gnomad.broadinstitute.org/api
- Used for variant annotation
-
AlphaMissense (pathogenicity predictions)
- 900MB download
- Uncomment in
scripts/download_data.pyto download
# Download full datasets (large files)
python scripts/download_data.py --full-
Get Real Genomic Data:
- 23andMe, AncestryDNA export
- Whole Genome Sequencing (WGS) from providers
- Targeted gene panels
-
Train on Clinical Data:
- Collect nutrient deficiency labels
- Hospital/clinic partnerships
- Update models with
models/nutrient_predictor.py
-
Add More Models:
- Disease risk (CVD, T2D, cancer)
- Longevity prediction
- Drug metabolism (pharmacogenomics)
-
Deploy to Production:
- Containerize with Docker
- Deploy to GCP/AWS
- Set up authentication
- HIPAA compliance
Issue: API calls failing (Ensembl/gnomAD)
- Solution: Rate limiting active - reduce concurrent requests
- Alternative: Download full databases locally
Issue: Model not found
- Solution: Run
python demo.pyfirst to train model - Or: Provide pre-trained model checkpoint
Issue: cyvcf2 not installing
- Solution: Fallback VCF parser included
- Works without cyvcf2 (slower but functional)
Issue: Out of memory
- Solution: Process VCF in batches
- Use Parquet files for large datasets
Questions? Issues?
- GitHub: [Issues page]
- Docs:
docs/folder - Examples:
demo.pyfor working code