Skip to content
pachterlabPublic

About

The Monod package fits CME models to sequencing data.

Resources

Stars

37 stars

Watchers

4 watching

Forks

Latest commit

 

History

317 Commits

Folders and files

Repository files navigation

Monod

PyPI version

Monod fits mechanistic models of transcription to single-cell sequencing data. Instead of summarising each gene by its mean expression, it treats the unspliced and spliced counts of every gene as draws from a stochastic model of bursting, splicing and degradation, and infers the model's rate parameters gene by gene. The result is a biophysical description of each gene, with the technical noise of the sequencing process modelled explicitly rather than normalised away.

The method is described in the Monod paper (Nature Methods, 2025), with the theory in Gorin & Pachter (2022). meK-Means, Monod's model-based clustering of cells, is described in Chari, Gorin & Pachter (2024).

Installation

pip install monod monod-core

Python 3.9 or newer is required. monod-core is an optional accelerator written in Rust, with prebuilt wheels for Linux and Apple-silicon Macs. Monod uses it automatically when it is present and runs in pure Python otherwise, with identical results and more patience required. If monod-core has no wheel for your platform, pip install monod alone is enough to get started.

Quick start

Monod works on an AnnData object whose layers hold integer unspliced and spliced counts, as produced by kallisto|bustools, velocyto or similar tools.

from monod.cme_toolbox import CMEModel
from monod.inference import perform_inference

model = CMEModel("Bursty", "Poisson")   # bursty transcription, Poisson sampling noise
adata = perform_inference("example_h5ad/example_adata.h5ad", model, n_genes=100)

adata.var[["$b$", r"$\beta$", r"$\gamma$", "AIC"]].head()

This selects the 100 most informative genes, fits each one, and writes the inferred burst size, splicing rate and degradation rate (all log10) into adata.var, alongside a goodness-of-fit score. Everything stays in the returned AnnData, which saves to an ordinary .h5ad file; nothing is written to disk unless you ask.

From there you can:

  • compare parameters between conditions with monod.analysis,
  • cluster cells by their transcriptional kinetics with meK-Means (monod.mminference),
  • swap in other models of transcription, sequencing noise, or ambient contamination,
  • add a protein layer or define your own reaction network.

Learning more

Citing

If you use Monod, please cite the Monod paper (Nature Methods, 2025), and for meK-Means, Chari, Gorin & Pachter (2024).

About

The Monod package fits CME models to sequencing data.

Resources

Stars

37 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages