This repository contains code, data layout, and notebooks to reproduce benchmarks and figures for the scMagnify.
This repository accompanies the preprint Decomposing multi-scale dynamic regulatory from single-cell multiomics with scMagnify (Chen*, ..., et al., bioRxiv, 2025).
- The repository is on GitHub here
- This repository contains all code used to benchmark
scMagnifyand generate the figures in the manuscript. - Jump to the Code to produce figures section for links to the specific notebooks for each figure panel.
- Python >= 3.10
- Install dependencies from pyproject.toml, e.g. with pip, If you don't have Python installed, we recommend installing uv.
uv pip install git+https://github.com/LiHongCSBLab/scMagnify.git@main- Re-run simulations/benchmarks:
- benchmark/simulation/* for scMultiSim evaluations
- benchmark/baseline/* for baseline method runs
- benchmark/scmagnify_multirun/* for multi-run configs/outputs
- Re-generate figures: see figures/Fig2–Fig6 assets and companion notebooks.
Programmatic API (src/grn_tools):
- from grn_tools import GRNEvaluator
- evaluator = GRNEvaluator(); evaluator.load_grns(...); evaluator.load_groundtruths(...)
- evaluator.calculate_accuracy(); evaluator.plot_performance_curves('pr'|'roc', group_by='Dataset'|'Lineage')
- benchmark/
- baseline/: scripts to run baseline GRN methods for comparison
- scmagnify_multirun/: hydra-based multi-run configs/outputs for scMagnify
- simulation/: notebooks and scripts for scMultiSim-based simulations and evaluation
- figures/, results/: aggregated outputs from benchmarks
- data/: input data stubs and dataset folders (large files hosted externally)
- figures/: figure-specific assets (Fig2–Fig6)
- notebooks/: jupyter-book scaffolding and templates
- scripts/: small helper scripts/templates
- src/grn_tools/: evaluation utilities
- GRNEvaluator.py: end-to-end GRN evaluation workflow
- _acc_metrics.py: AUPR/AUROC/F-score/EPR and batch evaluators
- _stab_metrics.py: Jaccard/Cosine stability metrics and plotting
- _plotting.py: plotting helpers (bar/violin/line/heatmaps)
- _utils.py: small helpers (matrix-to-edge, image merge, etc.)
- _constants.py: dataset paths, palettes, and ground-truth maps
This repository is meant to enhance the Materials & Methods section by providing code for all analyses in the manuscript, in order to improve reproducibility for the main results.
scMagnify-benchmark--> All scripts and notebooks for benchmarking and simulation.baseline--> Scripts for running baseline GRN inference methods (SCENIC, CellOracle, Velorama, etc.) for comparison.magnify_multirun-->hydra-based scripts for executingscMagnifyinference across different datasets and parameters (conf,multirun,outputs).simulation--> Jupyter notebooks for generating simulated data and evaluating the performance ofscMagnifyagainst baseline methods.
scMagnify-figures--> Jupyter notebooks organized by figure number, used to generate all main and supplementary figures in the manuscript.Fig2--> Notebooks for data preprocessing and TF binding/driver analysis.Fig3--> Notebooks for analyzing regulatory dynamics and time lags.Fig4--> Notebooks for RegFactor decomposition (NaiveB lineage).Fig5--> Notebooks for differential RegFactor analysis (Alpha vs. Beta lineage).Fig6--> Notebooks for intracellular communication (L-R to TF) analysis.
This table contains pointers to the key notebooks associated with each figure.
All data objects (.h5ad, .h5mu) used for the analyses are available on Zenodo: https://doi.org/10.5281/zenodo.YOUR_ZENODO_ID.
If you use this data or code, please cite:
Decomposing multi-scale dynamic regulatory from single-cell multiomics with scMagnify. Chen*, ..., et al., bioRxiv 2025; doi: https://doi.org/10.1101/YOUR_BIORXIV_ID