ordination {MatrixQCvis} | R Documentation

## Dimensionality reduction with ordination methods PCA, PCoA, NMDS, UMAP and tSNE

### Description

The function 'ordination' creates a 'data.frame' with the coordinates of the projected data. The function allows for the following projections: Principal Component Analysis (PCA), Principal Coordinates Analysis/Multidimensional Scaling (PCoA), Non-metric Multidimensional scaling (NMDS), t-distributed stochastic neighbor embedding (tSNE), and Uniform Manifold Approimation and Projection (UMAP).

### Usage

    ordination(x, type = c("PCA", "PCoA", "NMDS", "tSNE", "UMAP"), params = list())

### Arguments

`x` | 'matrix', containing no missing values, samples are in columns and features are in rows
`type` | 'character', specifying the type/method to use for dimensionality reduction. One of 'PCA', 'PCoA', 'NMDS', 'tSNE', or 'UMAP'.
`params` | 'list', arguments/parameters given to the functions 'stats::prcomp', 'stats::dist', 'Rtsne::Rtsne', 'umap::umap'

### Details

The function 'ordination' is a wrapper around the following functions 'stats::prcomp' (PCA), 'stats::cmdscale' (PCoA), 'vegan::metaMDS' (NMDS), 'Rtsne::Rtsne' (tSNE), and 'umap::umap' (UMAP). For the function 'umap::umap' the method is set to 'naive'.

### Value

'tbl'

### Author(s)

Thomas Naake

### Examples

    x <- matrix(rnorm(1:10000), ncol = 100)
    rownames(x) <- paste("feature", 1:nrow(x))
    colnames(x) <- paste("sample", 1:ncol(x))
    params <- list(method = "euclidean", ## dist
        initial_dims = 10, max_iter = 100, dims = 3, perplexity = 3, ## tSNE
        min_dist = 0.1, n_neighbors = 15, spread = 1) ## UMAP
    ordination(x, type = "PCA", params = params)
    ordination(x, type = "PCoA", params = params)
    ordination(x, type = "NMDS", params = params)
    ordination(x, type = "tSNE", params = params)
    ordination(x, type = "UMAP", params = params)

[Package MatrixQCvis version 1.2.4 Index]