Runs diffusion maps and coarse-graining on a Seurat object, writes intermediate files to disk, and launches a Python script (gene_distance_cal_parallel.py) in the background to compute pairwise gene EMDs via optimal transport. Results are saved to dir.path and can be loaded with LoadGeneEMD().

ComputeGeneEMD(
  srat,
  common_genes,
  dir.path,
  script_dir = NULL,
  npc = 10,
  K = 10,
  reduction = "dm"
)

Arguments

srat

A Seurat object. Must have a normalised RNA assay.

common_genes

Character vector of gene names to include in the computation (e.g., the output of SelectCommonGenes()).

dir.path

Character string. Path to the directory where intermediate and output files will be written.

script_dir

Character string or NULL. Path to the directory containing gene_distance_cal_parallel.py. If NULL (default), uses the bundled Python script included with the package.

npc

Integer. Number of diffusion map components to use. Default 10.

K

Integer. Number of nearest neighbours for the cell graph. Default 10.

reduction

Character string. Name of the dimensionality reduction to use when computing graph distances. Default "dm".

Value

Invisibly returns NULL. Results are written to dir.path.

Examples

if (FALSE) {
ComputeGeneEMD(srat, common_genes, dir.path = "results/emd/")
}