Run MDS (multi-dimensional scaling)
Usage
RunMDS(object, ...)
# S3 method for class 'Seurat'
RunMDS(
object,
assay = NULL,
layer = "data",
features = NULL,
nmds = 50,
dist.method = "euclidean",
mds.method = "cmdscale",
rev.mds = FALSE,
reduction.name = "mds",
reduction.key = "MDS_",
verbose = TRUE,
seed.use = 11,
...
)
# S3 method for class 'Assay'
RunMDS(
object,
assay = NULL,
layer = "data",
features = NULL,
nmds = 50,
dist.method = "euclidean",
mds.method = "cmdscale",
rev.mds = FALSE,
reduction.key = "MDS_",
verbose = TRUE,
seed.use = 11,
...
)
# S3 method for class 'Assay5'
RunMDS(
object,
assay = NULL,
layer = "data",
features = NULL,
nmds = 50,
dist.method = "euclidean",
mds.method = "cmdscale",
rev.mds = FALSE,
reduction.key = "MDS_",
verbose = TRUE,
seed.use = 11,
...
)
# Default S3 method
RunMDS(
object,
assay = NULL,
layer = "data",
nmds = 50,
dist.method = "euclidean",
mds.method = "cmdscale",
rev.mds = FALSE,
reduction.key = "MDS_",
verbose = TRUE,
seed.use = 11,
...
)Arguments
- object
An object. This can be a Seurat object, an assay object, or a matrix-like object.
- ...
Additional arguments to be passed to stats::cmdscale, MASS::isoMDS or MASS::sammon.
- assay
Which assay to use. If
NULL, the default assay of the Seurat object will be used. When the object also containsChromatinAssay, the default assay and additionalChromatinAssaywill be preprocessed sequentially.- layer
Which layer to use. Default is
data.- features
A character vector of features to use. Default is
NULL.- nmds
The number of dimensions to be computed. Default is
50.- dist.method
The distance metric to be used. Currently supported values are
"euclidean","chisquared","kullback","jeffreys","jensen","manhattan","maximum","canberra","minkowski", and"hamming". Default is"euclidean".- mds.method
The MDS algorithm to be used. Currently supported values are
"cmdscale","isoMDS", and"sammon". Default is"cmdscale".- rev.mds
Whether to perform reverse MDS (i.e., transpose the input matrix) before running the analysis. Default is
FALSE.- reduction.name
The name of the reduction to be stored in the Seurat object. Default is
"mds".- reduction.key
The prefix for the column names of the basis vectors. Default is
"MDS_".- verbose
Whether to print the message. Default is
TRUE.- seed.use
Random seed for reproducibility. Default is
11.
Examples
data(pancreas_sub)
pancreas_sub <- standard_scop(pancreas_sub)
pancreas_sub <- RunMDS(pancreas_sub)
CellDimPlot(
pancreas_sub,
group.by = "CellType",
reduction = "mds"
)