calculate_mds_pca: MDS or PCA

View source: R/plot_mds_pca.R

calculate_mds_pcaR Documentation

MDS or PCA

Description

Performs dimensionality reduction using multi-dimensional scaling (MDS) or principal component analysis (PCA) on the sample level.

Usage

calculate_mds_pca(
  se,
  assay = 1,
  method = "pca",
  dist = "euclidean",
  center = TRUE,
  scale = FALSE
)

Arguments

se

RangedSummarizedExperiment-class object

assay

Character or integer. Name or number of assay containing expression data to be used for dimensionality reduction.

method

Method to use: "pca" (default), "mds".

dist

Distance method to be used for MDS: see method argument in dist function.

center

Logical. Should the data be centered by mean? (default: TRUE).

scale

Logical. Should the data be scaled by standard deviation? (default: FALSE).

Value

list with components scores (data.frame with components of PCA or MDS analysis) and var.explained (vector with explained variance; only for PCA).

Examples

data("se.gene")

## PCA
res.pca = calculate_mds_pca(se = se.gene,
                            method = "pca")

## MDS
res.mds = calculate_mds_pca(se = se.gene,
                            method = "mds")

szymczak-lab/QCnormSE documentation built on March 25, 2023, 1:05 p.m.