lefsim¶
lefsim models and simulates the process of chromatin loop extrusion by
SMC-family complexes (e.g. cohesin and condensin).
In this system, loop-extrusion factors (LEFs) operate on a 1D lattice of chromatin sites, some of which may be extrusion barrier elements. Each LEF binds at a site and walks its two legs outward, extruding a loop, until it unbinds, encountering obstacles or barriers along the way.
Simulations are exact and event-driven: there's no fixed time step, only the next event.
The core is a Rust library, with bindings for two other environments:
| Package | Built with | Results as | |
|---|---|---|---|
| Rust | lefsim crate |
plain vectors | |
| Python | lefsim wheel |
pyo3 + maturin | Arrow |
| Browser | lefsim npm package |
wasm-bindgen | typed arrays or Arrow |
All three run the same core, so a seed gives the same run, bit for bit, in each.
What it does¶
- Simulates a model: a lattice with CTCF sites, LEFs on it, and the rates of their actions. You can step event by event, run to a time, or stream a run far too long to hold in memory.
- Records it: snapshots of every LEF on a time grid, or a lossless log of every change, with keyframes so any part can be replayed on its own.
- Replays it: rebuild the state at any recorded time, from memory, Arrow streams, or Parquet files (in the browser, reading only the parts it needs).
- Measures what loops do: the effective distance between any two sites when loops bring their anchors together.
Where to go next¶
- The Explorer App: run the model in your browser, and edit it as it runs.
- Getting started: install the library, and a first run in each language.
- The LEF model: what the legs and CTCFs do, and when LEFs unbind.
- The framework: the event-driven engine underneath.
- Recording and replay: snapshots, event logs, keyframes and files.
- The guides for Rust, Python and TypeScript.