Skip to content

an integrative algorithm to distinguish spatially variable cell subclusters by reconstructing cells onto a pseudo space with spatial transcriptome references

License

Notifications You must be signed in to change notification settings

ZJUFanLab/scSpace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scSpace v1.0.0

Reconstruction of cell pseudo space from single-cell RNA sequencing data

python >=3.8 DOI

scSpace (single-cell and spatial position associated co-embeddings) is an integrative algorithm that integrates spatial transcriptome data to reconstruct spatial associations of single cells within scRNA-seq data. Using transfer component analysis (TCA), scSpace could extract the characteristic matrixes of spatial transcriptomics and scRNA-seq, and project single cells into a pseudo space via a multiple layer perceptron (MLP) model, so that gene expression and spatial weight of cells can be embedded jointly for the further cell typing with higher accuracy and precision.

avatar

Code for generating the figures in this study can be found here.

Requirements and Installation

numpy 1.23.4 pandas 1.5.0 scikit-learn 1.1.2 scipy 1.9.2 scanpy 1.9.1 matplotlib 3.6.3 igraph 0.10.2 leidenalg 0.9.0 tqdm 4.64.1

Create and activate Python environment

For scSpace, 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 scspace python=3.8
conda activate scspace

Install pytorch

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

Install other requirements

cd scSpace-master
pip install -r requirements.txt

Install scSpace

python setup.py build
python setup.py install

Quick Start

To use scSpace we require five formatted .csv files as input (i.e. read in by pandas). We have included a toy dataset in the vignettes/data folder of this repository as examples to show how to use scSpace:

Tutorials

Additional step-by-step tutorials now available! Preprocessed datasets used can be downloaded from Google Drive.

  1. Spatial reconstruction of human DLPFC spatial transcriptomics data

  2. Spatial reconstruction of human SCC spatial transcriptomics data

  3. Spatial reconstruction of mouse intestine scRNA-seq data

  4. Spatial analysis of T cells subpopulations in melanoma

About

scSpace was developed by Jie Liao and Jingyang Qian. Should you have any questions, please contact Jie Liao at liaojie@zju.edu.cn, or Jingyang Qian at qianjingyang@zju.edu.cn

References

Qian, J., Liao, J., Liu, Z. et al. Reconstruction of the cell pseudo-space from single-cell RNA sequencing data with scSpace. Nat Commun 14, 2484 (2023). https://doi.org/10.1038/s41467-023-38121-4

About

an integrative algorithm to distinguish spatially variable cell subclusters by reconstructing cells onto a pseudo space with spatial transcriptome references

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published