Skip to contents

Computes pairwise E-distances on a Seurat object. Computes E-distance between all groups in a Seurat object in space given by reduction.

Usage

.edist(
  seurat_object,
  groupby,
  reduction,
  sample_correction = FALSE,
  verbose = TRUE
)

Arguments

seurat_object

An object of class Seurat.

groupby

An object of class character. Points to the column in the Seurat object's meta data that contains the group labels.

reduction

An object of class character. The reduction / embedding in seurat_object that is used to compute the E-distance in. Can be "pca", "harmony", or any linear dimensionality reduction.

sample_correction

An object of class logical. If TRUE, the E-distances are corrected for sample size. Will make it not a proper distance, leads to negative values.

verbose

An object of class logical. If TRUE, prints messages. Default is TRUE.

Value

Returns an object of class data.frame. For each group contains the E-test p-value and the E-distance to control group.

Note

This function is for internal use and is not exported. Computes pairwise E-distances on a Seurat object. Computes E-distance between all groups in a Seurat object in space given by reduction.

Examples

    # Add some code illustrating how to use the function