Metadata-Version: 2.4
Name: lefsim
Version: 0.1.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
License-File: LICENSE
Summary: Stochastic simulation of loop-extrusion factors on a 1D lattice
Keywords: loop extrusion,chromatin,cohesin,simulation,gillespie
Author: Nezar Abdennur
License-Expression: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://abdenlab.github.io/lefsim/
Project-URL: Repository, https://github.com/abdenlab/lefsim

# lefsim

Stochastic, event-driven simulation of loop-extrusion factors (LEFs) on a 1D
lattice of chromatin sites, with CTCF boundaries that capture or evict them. The
core is written in Rust. Results come back as Arrow data, readable by pyarrow,
polars, pandas and duckdb without copying, and the package has no Python
dependencies.

```
pip install lefsim
```

```python
import lefsim
import polars as pl

lattice = lefsim.Lattice(1000, {"site": [300, 700], "captures_from": ["right", "left"], "strength": 0.9})
world = lefsim.populate(lattice, 10, seed=1)
model = lefsim.Model(world, lefsim.Rates())

sim = lefsim.Sim(model, seed=42)
rec = sim.record_until(1000.0, dt=1.0)  # advance, taking a snapshot every time unit
pl.DataFrame(rec.snapshots)            # time, lef_id, left_pos, right_pos, mobilities
```

A seed gives the same run, bit for bit, here, in Rust and in the browser.

Documentation: <https://abdenlab.github.io/lefsim/>

