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 graph of cells can be embedded jointly for the further cell typing with higher accuracy and precision.
For scSpace, the python version need is over 3.8 and the R version need is over 4.1.
cd setup
pip install -r requirements.txt
Rscript requirements.R
Some important parameters in scSpace are listed bellow:
In pre-processing
step:
--project
: the name of the folder where the data is stored. Make sure it's in thedata/
directory--sc_data
: the name of input scRNA-seq data--sc_meta
: the name of input scRNA-seq metadata--st_data
: the name of input spatial transcriptomics data--st_meta
: the name of input spatial transcriptomics metadata. Make sure this file contains two columns ofxcoord
andycoord
--normalize
: normalize the data or not--st_type
:st
for spot-based ST data (10x Visium, Slide-seq, Slide-seq v2, etc) andimage
for imaged-based ST data (STARmap, MERFISH, seqFISH, etc)--n_features
: the number of genes selected for downstream analysis
In scSpace
step:
--kernel_type
: the kernel function used in transfer component analysis--dim
: the dimension of extracted characteristic representation across scRNA-seq and ST data--batch_size
: the batch size for multiple layer perceptron model training--lr
: the learning rate for multiple layer perceptron model training--epoch_num
: the total epoch number for multiple layer perceptron model training--sample_mlp
: use only a simple multiple layer perceptron model with three-layers--hidden_size
: the hidden layer size for simple multiple layer perceptron model--sub_cluster
: apply sub-clustering analysis for a specific cell type. IfFLASE
scSpace would apply clustering for all cells in scRNA-seq data--Ks
: the number of nearest cells in space graph--Kg
: the number of nearest cells in gene expression graph--res
: the resolution for scSpace clustering--target_num
: the target number of clusters for scSpace clustering. If--target_num 0
scSpace would apply clustering directly with resolution provided
scSpace was developed by Jie Liao and Jingyang Qian. Should you have any questions, please contact Jie Liao at [email protected], or Jingyang Qian at [email protected]