Compute global Moran's I spatial autocorrelation statistic

global_univ_spatcor(
  seurat,
  var = NULL,
  sim = 49,
  lag = 1,
  alt = "greater",
  seed = 347548
)

Arguments

seurat

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

var

character string or vector specifying the variable(s) to use to compute Moran's I statistics

sim

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

lag

integer value indicating the extent of cell/spot neighbours to be considered to calculate Moran 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.

alt

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

seed

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

Value

a data.frame reporting Moran's I spatial autocorrelation statistics with the associated p value for each selected variable.