Computes the LMD score of each gene given an expression matrix and cell space.

LMD(
  expression,
  feature_space,
  knn = 5,
  kernel = FALSE,
  max_time = 2^20,
  adjust_bridge = TRUE,
  self_loop = 1,
  score_correction = FALSE,
  largeData = TRUE,
  highres = FALSE,
  min_cell = 5
)

Arguments

expression

matrix; the gene by cell expression matrix.

feature_space

matrix; the cell by coordinate matrix (e.g., 20 principal components).

knn

integer; the number of nearest neighbors for constructing the graph. Default is 5.

kernel

logical; if TRUE, uses a Gaussian kernel. Otherwise, uses a kNN binarized graph. Default is FALSE.

max_time

integer; the maximum diffusion time. The actual maximum diffusion time may be shorter if all genes converge beforehand. Default is 2^20.

adjust_bridge

logical; if TRUE, connects disconnected components of the graph using Minimum Spanning Trees. Default is TRUE.

self_loop

integer; the weight for self-connections. Default is 1.

score_correction

logical; if TRUE, adjusts the LMD profile by delta correction. Default is FALSE.

largeData

logical; if TRUE, uses functions optimized for large matrix multiplication. Default is TRUE.

highres

logical; if TRUE, uses fine time scales (0, 1, 2, 3, ...). If FALSE, uses dyadic time scales (0, 2, 4, ...). Default is FALSE.

min_cell

integer; removes genes expressing in fewer than this number of cells. Default is 5.

Value

A list containing:

score_profile

data frame; the computed score profile for different diffusion times.

cumulative_score

numeric vector; the LMD score for each gene.