calculateDiffusionMap {scater} | R Documentation

## Create a diffusion map from cell-level data

### Description

Produce a diffusion map for the cells, based on the data in a SingleCellExperiment object.

### Usage

    calculateDiffusionMap(x, ...)

    ## S4 method for signature 'ANY'
    calculateDiffusionMap(x, ncomponents = 2, ntop = 500,
      subset_row = NULL, feature_set = NULL, scale = FALSE,
      scale_features = NULL, transposed = FALSE, ...)

    ## S4 method for signature 'SummarizedExperiment'
    calculateDiffusionMap(x, ...,
      exprs_values = "logcounts")

    ## S4 method for signature 'SingleCellExperiment'
    calculateDiffusionMap(x, ...,
      exprs_values = "logcounts", dimred = NULL, use_dimred = NULL,
      n_dimred = NULL)

    runDiffusionMap(x, ..., altexp = NULL, name = "DiffusionMap")

### Arguments

`x` | For `calculateDiffusionMap`, a numeric matrix of log-expression values where rows are features and columns are cells. Alternatively, a SummarizedExperiment or SingleCellExperiment containing such a matrix. For `runDiffusionMap`, a SingleCellExperiment object.
`...` | For the `calculateDiffusionMap` generic, additional arguments to pass to specific methods. For the ANY method, additional arguments to pass to `DiffusionMap`. For the SummarizedExperiment and SingleCellExperiment methods, additional arguments to pass to the ANY method. For `runDiffusionMap`, additional arguments to pass to `calculateDiffusionMap`.
`ncomponents` | Numeric scalar indicating the number of UMAP dimensions to obtain.
`ntop` | Numeric scalar specifying the number of features with the highest variances to use for PCA, see `?"scater-red-dim-args"`.
`subset_row` | Vector specifying the subset of features to use for PCA, see `?"scater-red-dim-args"`.
`feature_set` | Deprecated, same as `subset_row`.
`scale` | Logical scalar, should the expression values be standardised? See `?"scater-red-dim-args"` for details.
`scale_features` | Deprecated, same as `scale` but with a different default.
`transposed` | Logical scalar, is `x` transposed with cells in rows? See `?"scater-red-dim-args"` for details.
`exprs_values` | Integer scalar or string indicating which assay of `x` contains the expression values, see `?"scater-red-dim-args"`.
`dimred` | String or integer scalar specifying the existing dimensionality reduction results to use, see `?"scater-red-dim-args"`.
`use_dimred` | Deprecated, same as `dimred`.
`n_dimred` | Integer scalar or vector specifying the dimensions to use if `dimred` is specified, see `?"scater-red-dim-args"`.
`altexp` | String or integer scalar specifying an alternative experiment to use to compute the PCA, see `?"scater-red-dim-args"`.
`name` | String specifying the name to be used to store the result in the `reducedDims` of the output.

### Details

The function `DiffusionMap` is used internally to compute the diffusion map. The behaviour of `DiffusionMap` seems to be non-deterministic, in a manner that is not responsive to any `set.seed` call. The reason for this is unknown.

### Value

For `calculateDiffusionMap`, a matrix is returned containing the diffusion map coordinates for each cell (row) and dimension (column).

For `runDiffusionMap`, a modified `x` is returned that contains the diffusion map coordinates in `reducedDim(x, name)`.

### Author(s)

Aaron Lun, based on code by Davis McCarthy

### References

Haghverdi L, Buettner F, Theis FJ (2015). Diffusion maps for high-dimensional single-cell analysis of differentiation data. Bioinformatics 31(18), 2989-2998.

### See Also

`DiffusionMap`, to perform the underlying calculations.

`plotDiffusionMap`, to quickly visualize the results.

`?"scater-red-dim-args"`, for a full description of various options.

### Examples

    example_sce <- mockSCE()
    example_sce <- logNormCounts(example_sce)

    example_sce <- runDiffusionMap(example_sce, scale_features=NULL)
    reducedDimNames(example_sce)
    head(reducedDim(example_sce))

[Package scater version 1.14.0 Index]