A Statistical Learning Framework for Exploring Tumor Spatial Architecture from Spatially Resolved Transcriptomic Data.
Here, we introduce SpaTopic, a versatile statistical learning framework that harmonizes spatial clustering and cell-type deconvolution by integrating single-cell transcriptomics and SRT data. The objective of SpaTopic is to identify spatial clusters of spots within the SRT data, characterized by homogenous gene expression and cell-type organization. Each unique cluster of spots is viewed as a distinct spatial domain, presenting discernible patterns that set it apart from other clusters. SpaTopic significantly aids in the characterization of spatial domains, capitalising on the contributions from their corresponding cell-type topics. This enables the quantitative comparison of spatial domains and the identification of spatial regions prevalent across various SRT datasets. SpaTopic is implemented as an open-source R package, freely available at https://github.com/compbioNJU/SpaTopic.
Yuelei Zhang et al. ,SpaTopic: A statistical learning framework for exploring tumor spatial architecture from spatially resolved transcriptomic data. Sci. Adv.10,eadp4942(2024). DOI:10.1126/sciadv.adp4942
SpaTopic is implemented as an R package, which can be installed from GitHub.
- R (≥ 3.5.0)
- testthat (>= 3.0.0)
- R packages: modeltools, slam, stats, topicmodels
** Install devtools if necessary **
install.packages('devtools')Install SpaTopic
devtools::install_github('compbioNJU/SpaTopic')Load package
library(SpaTopic)All feedback, bug reports and suggestions are warmly welcomed! Please make sure to raise issues with a detailed and reproducible exmple and also please provide the output of your sessionInfo() in R!
This tutorial is the example analysis with SpaTopic on the human pancreatic ductal adenocarcinomas data from Moncada et al, 2020. Before runing the tutorial, make sure that the SpaTopic package is installed. Installation instructions see the Installation. See more at https://compbioNJU.github.io/SpaTopic/.
library(SpaTopic)load("data/spot_clusters.rda")
load("data/spot_celltype.rda")spot_clusters[1:5,1:5]
rowcolsizeFactorcluster.initspatial.cluster10x1010104.77611081210x1310131.00521992210x1410140.81068122210x1510150.49873772210x1610160.434614322spot_celltype[1:5,1:5]
Acinar_cellsDuctal_cellsCancer_clone_ACancer_clone_BDCs10x105.838572e-020.23490661.365076e-033.892868e-040.16586078910x134.807943e-050.99846771.654640e-069.032885e-060.00124463410x144.701190e-020.83736014.846860e-039.009235e-040.00354194710x155.047613e-020.80204651.911570e-043.325224e-020.08411311010x164.694120e-030.97180781.719378e-066.266388e-040.007665514#result_list: A list with three data frame and one vector. #MetaTopic is a data frame which can be add to a Seurat object. #The domain_topic is a data frame, row is CellTopic. and col is domain.#The celltype_topic is a data frame, row is celltype and col is CellTopic. #Cell_topic is a vector of which topic be chosen in each CellTopic. #If meta.cell = TRUE, one more result will be given in result list, MetaTopic is a data frame of the cluster result of CellTopic.result_list<- CellTopic(spot_celltype,spot_clusters,cluster="spatial.cluster", num_topics=13,percent=0.7,
Binarization=FALSE, meta.cell=FALSE, k=NULL)#show the result
head(result_list[["CellTopic"]])
CellTopicCellTopic1CellTopic2CellTopic3CellTopic410x10CellTopic20.5773826185448020.7873030320986540.00801702438657110.085344582159696510x13CellTopic20.5773826185448020.7873030320986540.00801702438657110.085344582159696510x14CellTopic20.5773826185448020.7873030320986540.00801702438657110.085344582159696510x15CellTopic20.5773826185448020.7873030320986540.00801702438657110.085344582159696510x16CellTopic20.5773826185448020.7873030320986540.00801702438657110.085344582159696510x17CellTopic20.5773826185448020.7873030320986540.00801702438657110.0853445821596965
head(result_list[["domain_topic"]])
spot_domain_1spot_domain_2spot_domain_3spot_domain_4CellTopic10.782076860.5773826190.1749538720.10799194CellTopic20.442117410.7873030320.0074385060.06603564CellTopic30.127125850.0080170240.7871815710.03422577CellTopic40.051057070.0853445820.0180052380.78840065
head(result_list[["celltype_topic"]])
CellTopic1CellTopic2CellTopic3CellTopic4Acinar_cells0.045034360.035154375.404895e-020.17033144Ductal_cells0.110627140.142138993.273553e-060.02809054Cancer_clone_A0.030903810.021575991.770954e-010.01540925Cancer_clone_B0.029434090.016714191.662732e-010.01086386DCs0.072682750.065579712.767503e-020.14179855Tuft_cells0.061133220.043744925.155769e-020.14100323
head(result_list[["Cell_topic"]])
CellTopic1CellTopic2CellTopic3CellTopic4"3_11_4_5_7_2""2_8_1_11_3""9_12""13_10"