This function allows you to detect sub-populations single-sample spatial transcriptomics experiments.
fit_spruce(
seurat_obj,
K,
emb = "PCs",
n_dim = 8,
r = 3,
MCAR = TRUE,
CAR = TRUE,
smooth = TRUE,
nsim = 2000,
burn = 1000,
z_init = NULL
)An integrated Seurat object
The number of sub-populations to infer. Each should be present in each sample.
Either one of "PCs", "HVGs", or "SVGs" OR a matrix with custom embeddings. If the latter, rows should be sorted as in meta data of Seurat object.
The number of dimensions to use if emb is specified as one of "PCs", "HVGs", or "SVGs". Ignored if emb is a matrix of custom embeddings.
Spatial smoothing parameter. Should be greater than 0 with larger values enforcing stronger prior spatial association.
Logical. Include multivariate CAR random intercepts in gene expression model?
Logical. Include univariate CAR random intercepts in multinomial gene expression model?
Logical. Use manual spatial smoothing controled by r parameter?
Number of total MCMC iterations to conduct.
Number of initial MCMC iterations to discard as burn in. The number of saved iterations is nsim-burn
Initialized cluster allocation vector to aid in MCMC convergence. If NULL z_init will be set using hierarchical clustering.
A list of MCMC samples, including the MAP estimate of cluster indicators (z)