SpatialPCA is a spatially aware dimension reduction method that aims to infer a low dimensional representation of the gene expression data in spatial transcriptomics. SpatialPCA builds upon the probabilistic version of PCA, incorporates localization information as additional input, and uses a kernel matrix to explicitly model the spatial correlation structure across tissue locations. SpatialPCA is implemented as an open-source R package, freely available at www.xzlab.org/software.html.
You can install the current version of SpatialPCA from GitHub with:
library(devtools)
install_github("shangll123/SpatialPCA")
Please see the SpatialPCA tutorial website.
The tutorial includes main example codes for multiple spatial transcriptomics datasets (e.g. DLPFC, Slide-Seq cerebellum, Slide-Seq V2 hippocampus, Human breast tumor, and Vizgen MERFISH.)
Other analysis codes for this project can be found here. Example data can be found here: https://drive.google.com/drive/folders/1Ibz5uNsFKHJ4roPpaec5nPL_EBF3-wxY?usp=share_link.
macOS Catalina 10.15.7
Ubuntu 18.04.5 LTS (Bionic Beaver)
CentOS Linux 7 (Core)
SpatialPCA is licensed under the GNU General Public License v3.0.
Lulu Shang, and Xiang Zhou (2022). Spatially aware dimension reduction for spatial transcriptomics. Nature Communications.