We present a spatial transition tensor (STT) method that utilizes mRNA splicing and spatial transcriptomes through a multiscale dynamical model to characterize multi-stability in space. By learning a four-dimensional transition tensor and spatial-constrained random walk, STT reconstructs cell-state specific dynamics and spatial state-transitions via both short-time local tensor streamlines between cells and long-time transition paths among attractors. Overall, STT provides a consistent multiscale description of single-cell transcriptome data across multiple spatiotemporal scales.
Install the dependencies by pip install -r requirements.txt
, and change directory to the ./example_notebooks
. Run the results with Jupyter Lab.
In MAC OS, if there's an issue with installing ptsc-related packages, it's recommended to refer to the trouble shooting here. Or below is alternative way to install in a seprate conda environment:
conda create -n stt python==3.7.6
conda activate stt
brew install gcc open-mpi openblas lapack arpack
conda install -c conda-forge pygpcca
pip install -r requirements-macos.txt
import sctt as st
adata.obs['attractor'] = # initialize the attractor, can use leiden or original annotation
adata_aggr = st.dynamical_iteration(adata,n_states =K, n_iter = 20, weight_connectivities = 0.5, n_neighbors = 100, n_components = 20,thresh_ms_gene = 0,thresh_entropy = 0.1)
# n_states: number of attractors
# n_iter: maximum of iteration
# thresh_entropy: the threshold of entropy difference between iterations to halt iteration, default is 0.1
# weight_connectivities: the weight of diffusion kernel as opposed to velocity kernel, default is 0.5
# n_neighbors: number of neighbors used to construct cellular random walk, default is 100
# n_component: number of eigen components to use in GPCCA decomposition, default is 20
# thresh_ms_gene: the threshold of minimum multi-stability score of genes to include when constructing random walk, default is 0
st.infer_lineage(adata,si=4,sf=3) # infer and plot the transition path
st.plot_tensor(adata, adata_aggr, basis = 'trans_coord',list_attractor = [0,1,2,3]) # plot the transition tensor components
st.plot_top_genes(adata, top_genes = 10) # plot the U-S diagram of top genes with the highest multi-stability score
The documentations of function APIs are available at here and the website is under active development to include more tutorials.
The available tutorials are also provided as annotated Jupyter notebooks below.
Tutorial 1:Basic Usage and Application on Toggle-switch Simulation Dataset
Tutorial 2:Analysis of Spatial Data,Pathway Visualization and Parameter sensitivity
Tutorial 3:Analysis of Chicken Heart Spatial Data, Dynamical Manifold and Transition Path Inference
System | Data Source | Notebook File |
---|---|---|
EMT circuit | Simulation Data in this study | notebook |
EMT of A549 cell lines | Cook et al. | notebook |
Erythroid lineage in mouse gastrulation | Pijuan-Sala et al. and scVelo | notebook |
Adult human bone marrow | Setty et al. and scVelo | notebook |
Developing Chicken Heart | Mantri et al. and SIRV | notebook |