Run DM (diffusion map)
Usage
RunDM(object, ...)
# S3 method for Seurat
RunDM(
object,
reduction = "pca",
dims = 1:30,
features = NULL,
assay = NULL,
slot = "data",
ndcs = 2,
sigma = "local",
k = 30,
dist.method = "euclidean",
reduction.name = "dm",
reduction.key = "DM_",
verbose = TRUE,
seed.use = 11,
...
)
# S3 method for default
RunDM(
object,
assay = NULL,
slot = "data",
ndcs = 2,
sigma = "local",
k = 30,
dist.method = "euclidean",
reduction.key = "DM_",
verbose = TRUE,
seed.use = 11,
...
)
Arguments
- object
An object. This can be a Seurat object or a matrix-like object.
- ...
Additional arguments to be passed to the DiffusionMap function.
- reduction
A character string specifying the reduction to be used.
- dims
An integer vector specifying the dimensions to be used. Default is 1:30.
- features
A character vector specifying the features to be used. Default is NULL.
- assay
A character string specifying the assay to be used. Default is NULL.
- slot
A character string specifying the slot name to be used. Default is "data".
- ndcs
An integer specifying the number of diffusion components (dimensions) to be computed. Default is 2.
- sigma
A character string specifying the diffusion scale parameter of the Gaussian kernel. Currently supported values are "local" (default) and "global".
- k
An integer specifying the number of nearest neighbors to be used for the construction of the graph. Default is 30.
- dist.method
A character string specifying the distance metric to be used for the construction of the knn graph. Currently supported values are "euclidean" and "cosine". Default is "euclidean".
- reduction.name
A character string specifying the name of the reduction to be stored in the Seurat object. Default is "dm".
- reduction.key
A character string specifying the prefix for the column names of the basis vectors. Default is "DM_".
- verbose
A logical value indicating whether to print verbose output. Default is TRUE.
- seed.use
An integer specifying the random seed to be used. Default is 11.
Examples
pancreas_sub <- Seurat::FindVariableFeatures(pancreas_sub)
pancreas_sub <- RunDM(object = pancreas_sub, features = Seurat::VariableFeatures(pancreas_sub))
#> Warning: You have 2000 genes. Consider passing e.g. n_pcs = 50 to speed up computation.
#> finding knns......done. Time: 3.54s
#> Calculating transition probabilities...
#> Warning: 'as(<dsCMatrix>, "dsTMatrix")' is deprecated.
#> Use 'as(., "TsparseMatrix")' instead.
#> See help("Deprecated") and help("Matrix-deprecated").
#> ...done. Time: 0.03s
#>
#> performing eigen decomposition......done. Time: 0.01s
CellDimPlot(pancreas_sub, group.by = "CellType", reduction = "dm")