Skip to contents

Run diffusion map dimensionality reduction on single-cell data.

Usage

RunDiffusionMap(object, ...)

# Default S3 method
RunDiffusionMap(
  object,
  assay = NULL,
  metric = "cosine",
  distance.matrix = NULL,
  ncomp = 20,
  reduction.name = "DiffMap",
  reduction.key = "DC_",
  weight.by.var = TRUE,
  verbose = TRUE,
  seed.use = 101,
  ...
)

# S3 method for class 'Assay'
RunDiffusionMap(
  object,
  assay = NULL,
  features = NULL,
  ncomp = 20,
  metric = "cosine",
  distance.matrix = NULL,
  reduction.name = "DiffMap",
  reduction.key = "DC_",
  weight.by.var = TRUE,
  verbose = TRUE,
  seed.use = 101,
  ...
)

# S3 method for class 'StdAssay'
RunDiffusionMap(
  object,
  assay = NULL,
  features = NULL,
  layer = "scale.data",
  ncomp = 20,
  metric = "cosine",
  distance.matrix = NULL,
  reduction.name = "DiffMap",
  reduction.key = "DC_",
  weight.by.var = TRUE,
  verbose = TRUE,
  seed.use = 101,
  ...
)

# S3 method for class 'Seurat'
RunDiffusionMap(
  object,
  assay = NULL,
  features = NULL,
  layer = "scale.data",
  ncomp = 20,
  metric = "cosine",
  distance.matrix = NULL,
  reduction.name = "DiffMap",
  reduction.key = "DC_",
  weight.by.var = TRUE,
  verbose = TRUE,
  seed.use = 101,
  ...
)

Arguments

object

An object to run diffusion map on

...

Additional arguments to be passed to DiffusionMap()

assay

Name of Assay diffusion map is being run on

metric

This determines the choice of metric used to measure distance in the input space. Check DiffusionMap() for details. If a distance.matrix is provided, this will be ignored.

distance.matrix

If set, runs DiffusionMap on the given distance matrix instead of data matrix.

ncomp

Number of components to compute

reduction.name

the name of the DimReduc object

reduction.key

dimensional reduction key, specifies the string before the number for the dimension names.

weight.by.var

Weight the cell embeddings by the variance of each PC

verbose

To print diagnostic messages. Default is TRUE.

seed.use

Set a random seed. Setting NULL will not set a seed.

features

Features to compute Diffusion Map

layer

The layer in assay to use when running diffusion map analysis.

Value

Returns a DimReduc object with diffusion map results

Examples

if (FALSE) { # \dontrun{
# Run diffusion map on a Seurat object
seurat_obj <- RunDiffusionMap(seurat_obj, ncomp = 10)
} # }