Skip to main content

RegDiffusion logo

Downloads Downloads PyPI - Version

RegDiffusion is a very fast unsupervised regulatory network inference algorithm (just like GENIE3 and GRNBoost2), based on probabilistic diffusion model. It works well on genes and is capable to rapidly (<5min) predict biologically verifiable links from large single cell RNA-seq data with 40,000+ genes.

Zhu H, Slonim D. From Noise to Knowledge: Diffusion Probabilistic Model-Based Neural Inference of Gene Regulatory Networks. J Comput Biol. 2024 Nov;31(11):1087-1103. doi: 10.1089/cmb.2024.0607. Epub 2024 Oct 10. PMID: 39387266; PMCID: PMC11698671.

Installation

RegDiffusion is on pypi.

pip install regdiffusion

Check out this tutorial for a quick tour of how to use RegDiffusion! If you would like to integrate results from RegDiffusion into the SCENIC pipeline, checkout this tutorial.

New in v0.2

  • Memory-efficient mode: Set memory_efficient=True in RegDiffusionTrainer to reduce peak GPU memory by ~45%, making it easier to work with large gene sets on consumer GPUs (You can now fit 20k genes on a 16GB GPU).
  • Sparse matrix support: RegDiffusionTrainer now accepts scipy sparse matrices directly (e.g., adata.X), enabling training on datasets with 1M+ cells without excessive memory usage.

Inferred Networks from RegDiffusion

Here are two examples of inferred networks from regdiffusion. The networks are coherent with existing literature and across datasets.

Inference Speed

Inference on networks with 15,000 genes takes under 5 minutes on an A100 GPU. In contrast, previous VAE based models would take more than 4 hours on the same device. Even if you don't have access to those fancy GPU cards, RegDiffusion still works. Inference on the same large network takes roughly 3 hours on a mid-range 12-core CPU.

CLI tool

regdiffusion has a CLI tool now! It takes a count matrix as the input (different from the main API, which needs the data to be log transformed) and returns a table of inferred edges.

usage: regdiffusion [-h] [--output OUTPUT] [--top_gene_percentile TOP_GENE_PERCENTILE] [--k K] [--workers WORKERS] input

Infer a gene regulatory network (GRN) from a single-cell count dataset.

positional arguments:
  input                 Input single-cell count dataset file (CSV or H5AD format).

options:
  -h, --help            show this help message and exit
  --output OUTPUT       Output file path for the edgelist (CSV). Default: rd_grn.csv
  --top_gene_percentile TOP_GENE_PERCENTILE
                        Percentile cutoff to filter weak edges (e.g., 50 for the top 50%). Default: 50
  --k K                 Number of edges per gene to extract (-1 for all edges). Default: -1
  --workers WORKERS     Number of workers to use for edgelist extraction. Default: 4

Citation

If you find our package useful, consider citing our paper! =)

@article{zhu2024noise,
  title={From Noise to Knowledge: Diffusion Probabilistic Model-Based Neural Inference of Gene Regulatory Networks},
  author={Zhu, Hao and Slonim, Donna},
  journal={Journal of Computational Biology},
  volume={31},
  number={11},
  pages={1087--1103},
  year={2024},
  publisher={Mary Ann Liebert, Inc., publishers 140 Huguenot Street, 3rd Floor New~…}
}

Release files for regdiffusion 0.2.3

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

Source distribution (sdist)

Source distribution for regdiffusion 0.2.3
File Size Uploaded
regdiffusion-0.2.3.tar.gz 13.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for regdiffusion 0.2.3
File Interpreter ABI Platform
regdiffusion-0.2.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 13.1 MB

Release files / regdiffusion-0.2.3.tar.gz

Download URL regdiffusion-0.2.3.tar.gz
Size 13.1 MB
Tags Source
SHA-256 checksum
How to use checksums
c819f4d49379e2552fd3cb0595b0625ad455f75fcba0e0020f8d57d34851b46a
BLAKE2b-256 checksum
How to use checksums
8f7dbcbb31f418c7a01f8ab283c9eaee87c0456ac15d160242e2455211bf533d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Release files / regdiffusion-0.2.3-py2.py3-none-any.whl

Download URL regdiffusion-0.2.3-py2.py3-none-any.whl
Size 42.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6140857f3d9f5ef362e5828121d4bf894b96e586f93d88ae69f95aa6ed92e97b
BLAKE2b-256 checksum
How to use checksums
814f2f7d9c6970cef915909920800372a392f79008c8d3f1df6603c75aa03d33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 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