Skip to contents

Compute Moran's I statistic for the vector field to assess spatial coherence of communication directions.

Usage

communication_spatial_autocorrelation(
  seurat_obj,
  database_name,
  key = "total",
  field = c("sender", "receiver"),
  spatial_coords = NULL,
  k = 5L,
  n_permutations = 999L,
  seed = NULL
)

Arguments

seurat_obj

Seurat object with vector field results.

database_name

Database name.

key

LR pair or pathway name.

field

"sender" or "receiver" vector field.

spatial_coords

Spatial coordinates.

k

Number of neighbors for spatial weights.

n_permutations

Number of permutations for p-value (default: 999).

seed

Random seed for reproducibility.

Value

List with Moran's I statistic, expected value, and p-value.

Details

Moran's I measures spatial autocorrelation. Positive values indicate that nearby cells have similar communication directions (spatially coherent signaling), while values near zero indicate random directions.