calcEMD: Calculate the Earth Mover's Distance Similarity for...

View source: R/models.R

calcEMDR Documentation

Calculate the Earth Mover's Distance Similarity for Interaction Data

Description

Calculate the Earth Mover's Distance Similarity for interaction data. The similarity is defined as 1-normalized Earth Mover's Distance.

Usage

calcEMD(
  data,
  idents,
  ligand,
  receptor,
  nbins = 100,
  weighted = TRUE,
  min_pct = 0,
  max_pct = 1,
  drop_zero = FALSE
)

Arguments

data

Expression data. A d x M matrix with d rows of features and M columns of data points (cells).

idents

Cell type identity in characters or factors.

ligand

Name or index for ligand.

receptor

Name or index for receptor.

nbins

Number of bins to use for Earth Mover's Distance calculation. Default is 100.

weighted

Logic, compute weighted Earth Mover's Distance which will give higher weight/penalty on lowly expressed genes. Default is TRUE.

min_pct

Values below this percentile will be replaced with this percentile's value. Default is 0.

max_pct

Values above this percentile will be replaced with this percentile's value. Default is 1.

drop_zero

Whether to drop all the zeros in the data. Default is FALSE.

Value

Returns Earth Mover's Distance matrix.


stevexniu/scMatchmaker documentation built on June 2, 2022, 12:35 p.m.