Compute spatial autocorrelation of communication direction
Source:R/communication_direction.R
communication_spatial_autocorrelation.RdCompute 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.