calculateMDS2: Perform MDS on cell-level data

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Perform multi-dimensional scaling (MDS) on cells, based on the data in a SummarizedExperiment object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
calculateMDS2(x, ...)

## S4 method for signature 'ANY'
calculateMDS2(
  x,
  FUN = calculateDistance,
  ncomponents = 2,
  ntop = 500,
  subset_row = NULL,
  scale = FALSE,
  transposed = FALSE,
  ...
)

## S4 method for signature 'SummarizedExperiment'
calculateMDS2(x, ..., exprs_values = "counts", FUN = calculateDistance)

Arguments

x

For calculateMDS, a numeric matrix of log-expression values where rows are features and columns are cells. Alternatively, a SummarizedExperiment containing such a matrix.

...

For the calculateMDS generic, additional arguments to pass to specific methods. For the SummarizedExperiment methods, additional arguments to pass to the ANY method.

FUN

a function returning a dist structure and accepting a matrix or a SummarizedExperiment as its first argument and does not have arguments name name, altexp, dimred or n_dimred.

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 dimensionality reduction.

subset_row

Vector specifying the subset of features to use for dimensionality reduction. This can be a character vector of row names, an integer vector of row indices or a logical vector.

scale

Logical scalar, should the expression values be standardized?

transposed

Logical scalar, is x transposed with cells in rows?

exprs_values

a single character value for specifying which assay to use for calculation.

Details

The function cmdscale is used internally to compute the MDS components.

Value

a matrix is returned containing the MDS coordinates for each row and column.

Author(s)

Aaron Lun, based on code by Davis McCarthy, modified for flexible distance function input by Felix G.M. Ernst

See Also

cmdscale, to perform the underlying calculations.

plotMDS, to quickly visualize the results.

Examples

1
2
3
4
5
6
7
# generate some example data
mat <- matrix(1:60, nrow = 6)
df <- DataFrame(n = c(1:6))
se <- SummarizedExperiment(assays = list(counts = mat),
                           rowData = df)
#
calculateMDS2(se)

FelixErnst/SEtup documentation built on Oct. 27, 2020, 11:35 p.m.