edist
dot-edist.RdComputes pairwise Energy distances between groups (cell states) in a Seurat object.
Usage
.edist(
seurat_object,
groupby,
reduction,
sample_correct = TRUE,
squared = FALSE,
verbose = TRUE
)Arguments
- seurat_object
A
Seuratobject.- groupby
A character scalar giving the name of a metadata column in
seurat_object@meta.datathat defines group labels.- reduction
A character scalar giving the name of a dimensional reduction (e.g.,
"pca","harmony") used for distance calculations. This should be a geometry-preserving representation; visualization-oriented nonlinear embeddings (e.g.,"umap","tsne") are not recommended for distance computation.- sample_correct
Logical; if
TRUE, uses the sample-size corrected (U-statistic) normalization for within-group terms (dividing by \(N(N-1)\) rather than \(N^2\)). Note that Energy distance can be negative due to finite-sample estimation noise even though the population quantity is non-negative.- squared
Logical; if
TRUE, uses squared Euclidean distances in the embedding space (matchingmetric="sqeuclidean"in some Python implementations). IfFALSE(default), uses Euclidean distances.- verbose
Logical; if
TRUE, prints progress messages.