runNMDS | R Documentation |
Perform non-metric multi-dimensional scaling (nMDS) on samples, based on the
data in a SingleCellExperiment
object.
getNMDS(x, ...)
## S4 method for signature 'ANY'
getNMDS(
x,
FUN = vegdist,
nmds.fun = nmdsFUN,
nmdsFUN = c("isoMDS", "monoMDS"),
ncomponents = 2,
ntop = 500,
subset.row = subset_row,
subset_row = NULL,
scale = FALSE,
transposed = FALSE,
keep.dist = keep_dist,
keep_dist = FALSE,
...
)
## S4 method for signature 'SummarizedExperiment'
getNMDS(
x,
...,
assay.type = assay_name,
assay_name = exprs_values,
exprs_values = "counts",
FUN = vegdist
)
## S4 method for signature 'SingleCellExperiment'
getNMDS(
x,
...,
assay.type = assay_name,
assay_name = exprs_values,
exprs_values = "counts",
dimred = NULL,
ndimred = n_dimred,
n_dimred = NULL,
FUN = vegdist
)
calculateNMDS(x, ...)
addNMDS(x, ..., altexp = NULL, name = "NMDS")
runNMDS(x, ...)
x |
|
... |
additional arguments to pass to |
FUN |
|
nmds.fun |
|
nmdsFUN |
Deprecated. Use |
ncomponents |
|
ntop |
|
subset.row |
|
subset_row |
Deprecated. Use |
scale |
|
transposed |
|
keep.dist |
|
keep_dist |
Deprecated. Use |
assay.type |
|
assay_name |
Deprecated. Use |
exprs_values |
Deprecated. Use |
dimred |
|
ndimred |
|
n_dimred |
Deprecated. Use |
altexp |
|
name |
|
For addNMDS
a SingleCellExperiment
Either MASS::isoMDS
or
vegan::monoMDS
are used internally to compute
the NMDS components. If you supply a custom FUN
, make sure that
the arguments of FUN
and nmds.fun
do not collide.
For getNMDS
, a matrix is returned containing the MDS
coordinates for each sample (row) and dimension (column).
MASS::isoMDS
,
vegan::monoMDS
for NMDS component calculation.
plotMDS
, to quickly visualize the
results.
# generate some example data
mat <- matrix(1:60, nrow = 6)
df <- DataFrame(n = c(1:6))
tse <- TreeSummarizedExperiment(assays = list(counts = mat),
rowData = df)
#
getNMDS(tse)
#
data(esophagus)
esophagus <- addNMDS(esophagus, FUN = vegan::vegdist, name = "BC")
esophagus <- addNMDS(esophagus, FUN = vegan::vegdist, name = "euclidean",
method = "euclidean")
reducedDims(esophagus)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.