Spaces:
Sleeping
Sleeping
OncoDSL Lab β React/Next.js front end (Stage 1 MVP)
Interactive front end for the genetic-programming engine. Talks to the FastAPI backend over JSON + Server-Sent Events. Reuses the same DSL, airgap harness, GP engine, and data the Streamlit viewer reads β but shows the GP evolving live, with a button-gated reveal at the end.
βββββββββββββββ POST /runs ββββββββββββββββββββββ
β β ββββββββββββββββββββΆ β FastAPI worker β
β Lab page β GET /runs/{id}/streamβ thread runs the β
β (Next.js) β ββββ SSE per-gen βββββ engine + permut. β
β β POST /evaluate β β
βββββββββββββββ ββββββββββββββββββββΆ ββββββββββββββββββββββ
The Lab is client-side (App Router "use client") because it
manages SSE, sliders, and reveal state.
Run
# 1) Backend (Python) β needs data/processed/{clinical,expression}.parquet
cd ..
source .venv/bin/activate
uvicorn api.app:app --reload # :8000
# 2) Frontend (Node β₯ 20)
cd web
npm install
npm run dev # :3000
Open http://localhost:3000.
Override the API base URL with NEXT_PUBLIC_API_URL:
NEXT_PUBLIC_API_URL=http://localhost:8001 npm run dev
The Streamlit viewer (streamlit run app/viewer.py) is unaffected β it
still reads the persisted MSI artefacts via the legacy /run /result /reveal
endpoints.
What's on the page
5 sections, top to bottom:
- Objective β pick MSI separation (AUROC) or Mutation burden (negative correlation). Survival and Unsupervised are Stage 2.
- Parameters β generations, population, genes-per-set, Ξ», seed, prefilter top-N, permutations. Sensible defaults.
- Run β POST
/runs, open SSE. - Live view β Recharts line chart of best & median fitness per generation, updated as events arrive; population grid showing the top candidates with survivors in the accent and discarded ones faded.
- Result + Reveal & evaluate β once the GP finishes, the winning program's metrics show. Click "Reveal & evaluate" against a reference gene set (MMR or immune) to translate the opaque IDs back to symbols and highlight the overlap.
What's NOT here (Stage 2 territory)
- React Flow program diagram. Animations. Free-text objective. Survival / unsupervised paths. Cross-cohort validation.