Compute bivariate global spatial correlation. You can use either Lee's L (default) or bivariate Moran's I statistics.

global_biv_spatcor(
  seurat,
  var1 = NULL,
  var2 = NULL,
  sim = 49,
  lag = 1,
  method = c("lee", "moran"),
  alt = "two.sided",
  layer = "data",
  seed = 347548
)

Arguments

seurat

a Seurat object containing Kandinsky data (`KanData()`)

var1

character string or vector specifying the first variable(s) to use to compute bivariate spatial correlation.

var2

character string or vector specifying the second variable(s) to use to compute bivariate spatial correlation

sim

number of Monte Carlo simulations to be run for estimating Moran/Lee coefficients significance

lag

integer value indicating the extent of cell/spot neighbours to be considered to calculate Moran/Lee statistics. `lag = 1` indicates that only 1st order neighbours will be considered, while `lag=2` indicates that all neighbours of each 1st order neighbour will be also considered for each spot/cell, and so on.

method

character string specifying which method to use to estimate spatial correlation. Must be one of the following: "lee" (default), "moran".

alt

a character string specifying the alternative hypothesis, Must be one of the following: "two.sided" (default), "greater" or "less".

layer

character string indicating which Seurat layer will be considered to search for the variable of interest

seed

numeric, random seed for reproducibility. Default is set to 347548

Value

a data.frame reporting the chosen spatial statistic coefficient with the associated p value for each possible combination between variables specified with `var1` `var2` parameters.