scCube is a Python package for independent, reproducible, and platform-diverse simulation of spatially-resolved transcriptomic data
- scCube now allows users to consider the heterogeneity within cell types and generate the spatial patterns of cell subtypes flexibly:
- scCube now allows users to generate more interpretable spatial patterns in a customized manner:
For scCube, the Python version need is over 3.8. If you have installed Python3.6 or Python3.7, consider installing Anaconda, and then you can create a new environment.
conda create -n sccube python=3.8
conda activate sccube
The version of pytorch should be suitable to the CUDA version of your machine. You can find the appropriate version on the PyTorch website. Here is an example with CUDA11.6:
pip install torch --extra-index-url https://download.pytorch.org/whl/cu116
cd scCube-main
pip install -r requirements.txt
python setup.py build
python setup.py install
scCube requires a data file (gene expression profiles) and a meta file (cell type/domain annotations) as the input, which can be stored as either .csv
(read by pandas) or .h5ad
(loaded by scanpy) formats. We have included two toy datasets in the tutorial/demo_data folder of this repository as examples to show how to use scCube.
Reference-based simulation:
- Demonstration of scCube on simulating mouse hypothalamus MERFISH data (same as the spatial reference)
- Demonstration of scCube on simulating mouse hypothalamus MERFISH data (different from the spatial reference)
Reference-free simulation:
- Demonstration of scCube on generating simulated spot-based SRT data
- Demonstration of scCube on generating simulated imaging-based SRT data
For more details about the format of input and the description of parameters, see here.
In the current version, scCube includes about 300 trained models of various tissues derived from four human and mouse scRNA-seq atlas (Tabula Muris, Tabula Sapiens, MCA, and HCL) as well as high-quality SRT datasets. Detailed information about these models and datasets can be found here.
Additional step-by-step tutorials are now available! Users can employ the trained models conveniently through the Python package to generate the new gene expression profiles of specific tissues. We provide the following tutorials as examples:
Reference-based simulation:
- Using scCube to simulate the mouse hypothalamus MERFISH data
- Using scCube to simulate the human DLPFC 10x Visium data
- Using scCube to simulate the mouse cortex STARmap data
- Using scCube to simulate the human breast cancer ST data
Reference-free simulation:
- Using scCube to simulate diverse spatial patterns
- Using scCube to simulate 3D spatial patterns
- Using scCube to simulate spatial patterns for user-specified cell types
- Using scCube to simulate the variability of resolution and spot arrangement of spot-based SRT data
scCube was developed by Jingyang Qian. Should you have any questions, please contact Jingyang Qian at qianjingyang@zju.edu.cn.
Qian, J., Bao, H., Shao, X. et al. Simulating multiple variability in spatially resolved transcriptomics with scCube. Nat Commun 15, 5021 (2024). https://doi.org/10.1038/s41467-024-49445-0