gelbench is a physics engine for DNA gel electrophoresis. It is written in Rust, compiled to WebAssembly and runs entirely in your browser — no install, no account. Change the field or the agarose and the gel is recomputed, not looked up.
Teaching scenarios
Each scenario asks you to predict where the bands will land, runs the engine, then shows what you got wrong and the physics behind it.
Plus a sandbox with every control unlocked.
What the engine computes
Scope: double-stranded DNA in agarose under a constant field. The goal is to get the relationships and the regimes right; every constant is traced to a source or marked as a placeholder.
Ogston sieving and biased reptation with field orientation, blended across the crossover. Plasmid forms I, II and III, with EtBr unwinding.
Diffusion in the gel after Pluen et al. (1999) and field-driven dispersion after Meistermann & Tinland (1998), both temperature-dependent.
Temperature-dependent conductivity; voltage, current or power mode; Joule heating across the gel width, from which the "smile" emerges.
Local pH from charge balance, ionic-strength screening, electrolysis at the electrodes and buffer depletion in each reservoir.
Bromophenol blue and xylene cyanol fronts; EtBr binding by a McGhee–von Hippel isotherm, its migration and its drag on DNA.
Buffer level, well capacity and overflow, sample density and float-out, uneven casting, fragments leaving the gel.
The same scenario gives a bit-identical result natively on Linux and Windows and as WebAssembly in the browser. CI checks this on every change.
About 2.5 ms per simulation step in the browser, so most scenarios compute in a few seconds.
Validation
Some data sets were used to calibrate the model; others were held out and only compared against. The difference is marked.
| Source | What is compared | Agreement |
|---|---|---|
| Holmes & Stellwagen 1990 calibration | Absolute DNA mobility | RMS 4.2 % |
| Rill 2002 calibration | Mobility at 5.0 and 3.5 V/cm | RMS 4.7–4.9 % |
| Rill 2002 held out | Other agarose concentrations | RMS 10–13 % |
| Van Winkle 2002 held out | Size curve, 200 bp – 12 kb at 1 % | within 15 % |
| Stellwagen 1997 held out | Free-solution mobility | −1.9 % |
| Sigmon 1996 calibration | EtBr retardation of DNA | within 0.5 pp |
The simulator shows these caveats on the gel itself whenever a run touches one of them.
Contact
If you teach electrophoresis, have measurements the model gets wrong, or want to try it with students — write.