## we generate the spatial transcriptomics data with lattice neighborhood, i.e. ST platform.
data(seu)
library(Seurat)
seu <- NormalizeData(seu)
# choose spatially variable features using Seurat
seu <- FindSVGs(seu)
# use SVGs to fit DR.SC model
# maxIter = 2 is only used for illustration, and user can use default.
seu1 <- DR.SC(seu, K=4,platform = 'ST', maxIter=2,verbose=FALSE)
spatialPlotClusters(seu1)
Run the code above in your browser using DataLab