fit_spruce: Fit spruce Bayesian spatial mixture model

View source: R/fit_spruce.R

fit_spruceR Documentation

Fit spruce Bayesian spatial mixture model

Description

This function allows you to detect sub-populations single-sample spatial transcriptomics experiments.

Usage

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
)

Arguments

seurat_obj

An integrated Seurat object

K

The number of sub-populations to infer. Each should be present in each sample.

emb

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.

n_dim

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.

r

Spatial smoothing parameter. Should be greater than 0 with larger values enforcing stronger prior spatial association.

MCAR

Logical. Include multivariate CAR random intercepts in gene expression model?

CAR

Logical. Include univariate CAR random intercepts in multinomial gene expression model?

smooth

Logical. Use manual spatial smoothing controled by r parameter?

nsim

Number of total MCMC iterations to conduct.

burn

Number of initial MCMC iterations to discard as burn in. The number of saved iterations is nsim-burn

z_init

Initialized cluster allocation vector to aid in MCMC convergence. If NULL z_init will be set using hierarchical clustering.

Value

A list of MCMC samples, including the MAP estimate of cluster indicators (z)


spruce documentation built on March 18, 2022, 7:01 p.m.

Related to fit_spruce in spruce...