fit_maple | R Documentation |
This function allows you to detect sub-populations and explain membership with relevant covariates in multi-sample spatial transcriptomics experiments.
fit_maple( seurat_obj, K, emb = "PCs", n_dim = 8, covars = NULL, MCAR = FALSE, CAR = FALSE, smooth = TRUE, r = 3, nsim = 2000, burn = 1000, z_init = NULL )
seurat_obj |
An integrated Seurat object. |
K |
The number of sub-populations to infer. Each should be present in each sample. |
emb |
The cell spot embedding to use. Either one of "PCs", "scGNN", "harmony", "HVGs", or "SVGs". |
n_dim |
The number of dimensions to use. |
covars |
Column names of Seurat meta data to use as covariates. If none specified, will fit a global intercept and sample-indicator model for cell type membership probabilities. |
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 controlled by r parameter? |
r |
Spatial smoothing parameter for if smooth == TRUE. Should be greater than 0 with larger values enforcing stronger prior spatial association. |
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. |
A list of MCMC samples, including the MAP estimate of cluster indicators (z)
## Not run: brain1 <- LoadData("stxBrain", type = "anterior1") brain2 <- LoadData("stxBrain", type = "anterior2") brain1 <- SCTransform(brain1, assay = "Spatial", verbose = FALSE) brain2 <- SCTransform(brain2, assay = "Spatial", verbose = FALSE) brain <- merge(brain1,brain2) DefaultAssay(brain) <- "SCT" VariableFeatures(brain) <- c(VariableFeatures(brain1),VariableFeatures(brain2)) brain <- RunPCA(brain) brain_fit_PCs <- fit_maple(brain,K = 6,emb = "PCs") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.