Install the DR.SC

This vignette provides an introduction to the R package DR.SC, where the function DR.SC implements the model DR-SC, spatial clustering with hidden Markov random field using empirical Bayes. The package can be installed with the following command from Github:

install.packages('remotes') remotes::install_github("feiyoung/DR.SC")

or install from CRAN

install.packages("DR.SC")

The package can be loaded with the command:


library("DR.SC")
#> Loading required package: parallel
#> Loading required package: spatstat.geom
#> Warning: package 'spatstat.geom' was built under R version 4.1.3
#> Loading required package: spatstat.data
#> Warning: package 'spatstat.data' was built under R version 4.1.3
#> spatstat.geom 2.4-0
#> DR.SC :  Joint dimension reduction and spatial clustering is conducted for
#> Single-cell RNA sequencing and spatial transcriptomics data, and more details can be referred to
#> Wei Liu, Xu Liao, Yi Yang, Huazhen Lin, Joe Yeong, Xiang Zhou, Xingjie Shi and Jin Liu. (2022) <doi:10.1093/nar/gkac219>. It is not only computationally efficient and scalable to the sample size increment, but also is capable of choosing the smoothness parameter and the number of clusters as well.

Setup on Linux or MacOS system

For running big data, users can use the following system command to set the C_stack unlimited in case of R Error: C stack usage is too close to the limit.

ulimit -s unlimited