calculateMDS {scater} | R Documentation |
Perform multi-dimensional scaling (MDS) on cells, based on the data in a SingleCellExperiment object.
calculateMDS(x, ...) ## S4 method for signature 'ANY' calculateMDS(x, ncomponents = 2, ntop = 500, subset_row = NULL, feature_set = NULL, scale = FALSE, scale_features = NULL, transposed = FALSE, method = "euclidean") ## S4 method for signature 'SummarizedExperiment' calculateMDS(x, ..., exprs_values = "logcounts") ## S4 method for signature 'SingleCellExperiment' calculateMDS(x, ..., exprs_values = "logcounts", dimred = NULL, use_dimred = NULL, n_dimred = NULL) runMDS(x, ..., altexp = NULL, name = "MDS")
x |
For For |
... |
For the For |
ncomponents |
Numeric scalar indicating the number of MDS?g dimensions to obtain. |
ntop |
Numeric scalar specifying the number of features with the highest variances to use for PCA, see |
subset_row |
Vector specifying the subset of features to use for PCA, see |
feature_set |
Deprecated, same as |
scale |
Logical scalar, should the expression values be standardised? See |
scale_features |
Deprecated, same as |
transposed |
Logical scalar, is |
method |
String specifying the type of distance to be computed between cells. |
exprs_values |
Integer scalar or string indicating which assay of |
dimred |
String or integer scalar specifying the existing dimensionality reduction results to use, see |
use_dimred |
Deprecated, same as |
n_dimred |
Integer scalar or vector specifying the dimensions to use if |
altexp |
String or integer scalar specifying an alternative experiment to use to compute the PCA, see |
name |
String specifying the name to be used to store the result in the |
The function cmdscale
is used internally to compute the MDS components.
For calculateMDS
, a matrix is returned containing the MDS coordinates for each cell (row) and dimension (column).
For runMDS
, a modified x
is returned that contains the MDS coordinates in reducedDim(x, name)
.
Aaron Lun, based on code by Davis McCarthy
cmdscale
, to perform the underlying calculations.
plotMDS
, to quickly visualize the results.
?"scater-red-dim-args"
, for a full description of various options.
example_sce <- mockSCE() example_sce <- logNormCounts(example_sce) example_sce <- runMDS(example_sce, scale_features=NULL) reducedDimNames(example_sce) head(reducedDim(example_sce))