What it is
Gel electrophoresis is a standard technique for separating DNA or protein fragments by size. The output is a photograph — a few vertical lanes of dark bands against a lighter background — and the analysis is: identify the bands, measure their positions relative to a ladder of known-size markers, and estimate the molecular weight of the samples.
GelSM turns that entire workflow into a desktop app: import a photo, crop and deskew, drop a seam-ladder calibration, register lane boundaries, click on bands to get MW estimates, and export an annotated figure or an analysis bundle for downstream ELN systems.
Architecture
Clean three-layer split, with the boundaries picked to match the actual work:
- TypeScript renderer (~5,000 LOC). Handles all the canvas interaction — crop, deskew, straighten, lane registration, MW calibration via seam ladder, band selection, 20-step undo. Also owns the seam-replay logic so calibration survives width changes when you re-crop.
- Electron main process. File I/O, project lifecycle, and the persistent-worker abstraction over the Python side. Handles the
.gelproj/ project format (a folder containing project.json, PNG stack, and optional electropherogram metadata).
- Python persistent worker. Image operations that need Pillow + scipy — deskew, auto-crop, picture correction, seam-ladder calibration, MW interpolation, and Western-blot rendering variants. Runs as a JSON-over-stdin worker so heavy imports get paid once and reused across every operation, not per-invocation.
Notable engineering
- Seam ladder calibration. Not just "click the ladder positions" — the ladder marks persist across crop/straighten operations via seam replay, so calibration doesn't need to be redone when the image geometry changes.
- Multi-ladder MW interpolation. Gels can have ladders in multiple lanes. GelSM interpolates between them for samples that fall between reference points.
- Standalone distribution. Ships as a Squirrel installer (217 MB) with a full Python runtime embedded — drop-in install on a lab machine with no external dependencies.
Fast facts
Project format
.gelproj/ folder
Export
PNG + analysis bundle