Skip to main content

RustScenic

Fast, memory-efficient gene-regulation analysis for single-cell data.

Infer gene networks and score their activity using RNA and chromatin-accessibility data. A Python package accelerated with Rust. Runs on CPUs; no GPU required.

Created and maintained by Ekin Kahraman, developed in collaboration with the Kuan-Lin Huang Lab at the Icahn School of Medicine at Mount Sinai.

Documentation | Benchmarks | Validation | Citation | Zenodo DOI

CI Docs Nightly real-data validation PyPI
Zenodo DOI License: Apache-2.0 Python Rust

Highlights

  • Gene-network inference on 1.3 million mouse-brain cells in under 47 minutes, with 4.28 GB peak memory during analysis on 16 CPU cores (v0.5.0 benchmark).
  • 3.3x faster with about 81% less peak physical memory than arboreto in a controlled 20,000-cell gene-network comparison on the same hardware.
  • 21.4% lower topic-model peak memory, with unchanged output files in repeated mouse-brain tests (v0.5.0 memory audit).
  • 11x to 52x faster than SCENIC+ for selected analysis stages on sampled real-data inputs, measured on one machine.
  • Huang Lab collaborator run recovered 16/17 expected brain transcription factors in human brain data.

The first three results were measured on the v0.5.0 release candidate. The million-cell run used prepared RNA and 2,095 selected genes; separate full-data preparation peaked at 71.49 GB. These measurements do not describe a complete million-cell spatial workflow.

Current release: v0.5.0. Python 3.10 to 3.13; Linux, macOS and Windows. Core analysis runs without Java, dask, CUDA or Snakemake.

Installation

pip install rustscenic

Upgrading from 0.4.x

v0.5.0 reduces memory use and adds separate positively and negatively correlated target sets. Gene-network fitting now follows arboreto's stopping rule; use early_stop_mode="legacy_inbag" only to reproduce the previous behaviour. See the release notes for compatibility options and the change to Apache-2.0. Earlier published releases remain under MIT.

Benchmark Evidence

The SCENIC+ comparison starts from prepared matrices and measures gene-network inference, enhancer links and activity scores. It excludes raw-data processing, topic modelling and motif-database construction.

The tools use different methods for enhancer linking: RustScenic uses correlation over the fixed search space, while SCENIC+ uses boosted trees plus Pearson scoring for region-to-gene links.

Machine: Apple M5 laptop, 16 GB RAM, macOS arm64, 4 CPU threads. RustScenic rows used Python 3.13.9; SCENIC+ reference rows used Python 3.11.8 for its dependency stack. Rows can be sampled subsets; the shape column is the actual benchmark input.

Dataset Shape RustScenic SCENIC+ Speedup Peak RSS (RustScenic / SCENIC+)
PBMC3k dense 2,000 cells, 4,000 genes, 8,000 peaks, 30 TFs 4.98 s 258.9 s 52x 1.21 / 1.26 GB
PBMC10k dense 2,000 sampled cells, 4,000 genes, 8,000 peaks, 30 TFs 21.5 s 241.5 s 11x 2.37 / 2.63 GB
Mouse brain E18 1,500 cells, 3,000 genes, 6,000 peaks, 25 TFs 2.82 s 90.4 s 32x 1.65 / 2.10 GB
Human brain GEM-X 2,000 cells, 4,000 genes, 8,000 peaks, 30 TFs 7.41 s 146.0 s 19.7x 2.18 / 2.19 GB

Including data preparation, the human brain GEM-X row is 11.89 s for RustScenic versus 150.36 s for SCENIC+.

Full commands, hardware, validation metrics and output signatures are in site_docs/benchmarks.md.

Stage Coverage

Stage RustScenic API SCENIC ecosystem stage covered
TF-to-gene GRN rustscenic.grn.infer GRNBoost2-style regulatory-network inference
AUCell rustscenic.aucell.score Per-cell regulon activity scoring
cisTarget rustscenic.cistarget.enrich Motif enrichment and support filtering
Topics rustscenic.topics.fit, fit_gibbs scATAC topic modelling
ATAC preprocessing rustscenic.preproc Fragment matrix building and QC
Enhancer links rustscenic.enhancer.link_peaks_to_genes Peak-to-gene linking
eRegulons rustscenic.eregulon.build_eregulons Enhancer-linked regulon assembly
Orchestration rustscenic.pipeline.run Staged workflow across RNA and multiome inputs

Quick Start

This example uses v0.5.0. It builds candidate gene sets from network edges and scores their activity; these sets have not been filtered for motif support or split by positive and negative correlation.

import anndata as ad
import rustscenic.aucell
import rustscenic.data
import rustscenic.grn

adata = ad.read_h5ad("rna.h5ad")
tfs = rustscenic.data.tfs("hs")

grn = rustscenic.grn.infer(
    adata, tf_names=tfs, n_estimators=5000, top_targets_per_tf=50, seed=777
)
regulons = {
    tf: group["target"].tolist()
    for tf, group in grn.groupby("TF")
    if len(group) >= 10
}
auc = rustscenic.aucell.score(adata, regulons, top_frac=0.05)

Command line:

rustscenic pipeline --rna data.h5ad --tfs tfs.txt --output out/
rustscenic grn --expression rna.h5ad --tfs tfs.txt --output grn.parquet
rustscenic aucell --expression rna.h5ad --regulons grn.parquet --output aucell.parquet
rustscenic topics --expression atac.h5ad --output topics.parquet --n-topics 30
rustscenic cistarget --rankings rankings.feather --regulons regulons.tsv --output motifs.parquet

See examples/pbmc3k_end_to_end.py for a small real-data RNA example.

v0.5.0 also provides add_correlation, build_regulons, and rustscenic add-cor to separate target sets by correlation sign. See the API map for those features. A correlation sign is not experimental proof of activation or repression.

Validation

Validation axis Result
cisTarget kernel Pearson 1.0000 against ctxcore.recovery.aucs; mean absolute difference about 2.4e-5.
AUCell parity Ziegler 2021 airway atlas mean per-cell Pearson 0.984; 91.7% of cells above 0.95.
Human brain GEM-X benchmark Region-to-gene Jaccard 1.000; region AUCell mean Pearson 0.823.
Collaborator analysis A human brain RNA/chromatin workflow recovered 16/17 expected brain transcription factors.
Open parity targets Gene AUCell Pearson 0.386 and eRegulon edge Jaccard 0.161 on the human brain GEM-X row.

Validation artefacts live under validation/. Public interpretation lives in site_docs/benchmarks.md and site_docs/validation.md.

Current Boundaries

  • The SCENIC+ speedups cover selected analysis stages, not every possible raw-data and motif-database workflow.
  • GRN, gene AUCell and eRegulon edge agreement are not claimed to be bit-identical to SCENIC+; see Benchmarks for the parity metrics.
  • v0.5.0 changes grn.infer to arboreto-compatible early stopping. Use early_stop_mode="legacy_inbag" only to reproduce historical RustScenic stopping behaviour. The pipeline defaults to separate activator and repressor regulons; grn_regulon_polarities="unsigned" is the explicit compatibility path.
  • Complete million-cell spatial workflows and an atlas-wide CELLxGENE resource remain outside the validated scope.

Documentation

Citation

If you use RustScenic in a paper, report, benchmark, derivative package or lab workflow, cite the exact release used. GitHub citation metadata is in CITATION.cff. Zenodo concept DOI: 10.5281/zenodo.20246040.

RustScenic is created and maintained by Ekin Kahraman. See AUTHORS.md for attribution.

Metadata

Release files for rustscenic 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rustscenic 0.5.0
File Size Uploaded
rustscenic-0.5.0.tar.gz 212.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for rustscenic 0.5.0
File
rustscenic-0.5.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
rustscenic-0.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
rustscenic-0.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
rustscenic-0.5.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
rustscenic-0.5.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 6.1 MB

Release files / rustscenic-0.5.0.tar.gz

Download URL rustscenic-0.5.0.tar.gz
Size 212.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a15ce6610f17ced1dafc86f3be080bf37a695b498e3f0b6db42177eb33ccf00d
BLAKE2b-256 checksum
How to use checksums
e30855541d00f13c8400575c28b1d380a86a39e1fb72bf2f202386e6580e449c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / rustscenic-0.5.0-cp310-abi3-win_amd64.whl

Download URL rustscenic-0.5.0-cp310-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a8d768a79bb088dcfa15b19954a5b1bfb972ec8280cb945e702f8aaf422f24c8
BLAKE2b-256 checksum
How to use checksums
527a926962d7e03ed92fd8eae142ae75673bbfa0f3b20a5ee468d302f9de55b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / rustscenic-0.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rustscenic-0.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
3750a705775641333c47085cb6e3e27e74932f138a8d507b616aad904e4897bc
BLAKE2b-256 checksum
How to use checksums
1a348172ee79a5bc5a918a011854d6c580ef60c3d1adb49cc36915d2c4f7b905
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / rustscenic-0.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL rustscenic-0.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.2 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
87d978921678eeb3f9fc464de5beb2272f79abbcaa834ada88d275f09587b3e0
BLAKE2b-256 checksum
How to use checksums
849ccf4160182f430ad7b7b0a6e8bad514b7808d8fc2ff9b2d3f87695e484ffe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / rustscenic-0.5.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL rustscenic-0.5.0-cp310-abi3-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c6bba0721593c4a841cdcc25b1a9955adf1e92937a6dfab31a67ed763c0d6bed
BLAKE2b-256 checksum
How to use checksums
23018796f46c22e1a092e0d410bd75700bb9c8e1a22904b842f1eafe36c840eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / rustscenic-0.5.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL rustscenic-0.5.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 1.2 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f24bf8d1fe7e8ed2e2265bdcb4d91e2ba6ac47fd0671cfb0cbd221b405e759b2
BLAKE2b-256 checksum
How to use checksums
ee5690f1938c75218738e69ce9669939c00c871c4707604265b806f94686562f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

6 release files

0.4.7

6 release files

0.4.6

6 release files

0.4.5

6 release files

0.4.4

5 release files

0.4.3

5 release files

0.4.2

5 release files

0.4.1

5 release files

0.4.0

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page