SpatialTopic clustering performed by calling the R package SpaTopic through Kandinsky

spatopic_clust(
  data = NULL,
  label = NULL,
  sample_key = NULL,
  n_clust = 2:9,
  sigma = 25,
  region_radius = 500,
  kneigh = 5,
  trace = TRUE,
  thin = 20,
  burnin = 1000,
  niter = 200,
  seed = 347548
)

Arguments

data

Seurat object containing Kandinsky data

label

character string specifying the variable name to be used to defne cell annotation groups

sample_key

character string specifying a variable stored in the Seurat object to use as sample/batch annotation. If not NULL, neighbour networks will be defined separately for each sample/batch. Default is NULL.

n_clust

numeric, number of expected clusters. Can be a single number or a numeric vector if multiple cluster numbers needs to be tested

sigma

Default is 50. The lengthscale of the Nearest-neighbor Exponential Kernel. Sigma controls the strength of decay of correlation with distance in the kernel function. Please check the paper for more information. Need to be adjusted based on the image resolution

region_radius

Default is 400. The radius for each grid square when sampling region centers for each image. Need to be adjusted based on the image resolution and pattern complexity.

kneigh

Default is 5. Only consider the top 5 closest region centers for each cell.

trace

Default is TRUE Compute and save log likelihood, Ndk, Nwk for every posterior samples. Useful when you want to use DIC to select number of topics, but it is time consuming to compute the likelihood for every posterior samples.

thin

Default is 20. Key parameter in Gibbs sampling. Collect a posterior sample for every thin=20 iterations.

burnin

Default is 1000. Key parameter in Gibbs sampling. Start to collect posterior samples after 1000 iterations. You may increase the number of iterations for burn-in for highly complex tissue images.

niter

Default is 200. Key parameter in Gibbs sampling. Number of posterior samples collected for model inference.

seed

Default is 347548 Random seed.

Value

updated Seurat object with 'spatopic_clusters' annotation added to metadata slot

Details

SpaTopic must be installed within the same environmnent of Kandinsky