rarelens — system architecture
One monorepo: scientific pipeline, API, UI, model serving and two deployment tracks. Arrows are data flow.
Clinical scientist
Enters a proband: a VCF plus the patient's HPO phenotype terms.
SvelteKit UI
Svelte 5 runes, adapter-node. Same-origin /api proxy, so no CORS.
web/
→
FastAPI
Cases, jobs, candidate ranking, decisions, case report. Pydantic v2 + SQLAlchemy 2.0 async.
api/app/ — 1,380 lines
Triage service
Weighted mean of four auditable components; a component with no evidence abstains.
app/services/triage.py
→
PostgreSQL 16
Cases, phenotypes, jobs, variants, predictions, decisions.
Alembic migrations
HPO reference
876,585 gene–phenotype annotations after ontology propagation; 11,829 terms with information content.
→
MLflow registry
LightGBM pyfunc carrying its own feature code, resolved by alias @production. MODEL_URI loads an artifact with no server running.
ml/
Nextflow DSL2 pipeline
bcftools normalise → Ensembl VEP → loader. Executors: local, Google Batch, Argo Workflows.
pipeline/
Deployment track A — serverless (default, ~£1/month idle)
Cloud Run
api + web, min-instances 0
→
Cloud Run job
Nextflow driver, started per run
→
Google Batch
VEP tasks on Spot VMs
Deployment track B — Kubernetes (behind a Terraform flag)
Pub/Sub
vcf-uploaded topic
→
Argo Events
sensor → workflow trigger
→
Argo Workflows
on GKE Autopilot
Both tracks run the identical pipeline code; the executor is a Nextflow profile, and ArgoCD reconciles the Kubernetes track from the same repository.