plot_mds_pca: MDS or PCA plot

View source: R/plot_mds_pca.R

plot_mds_pcaR Documentation

MDS or PCA plot

Description

Plots components estimated with the function calculate_mds_pca. Color and shape of each sample can be set based on different variables.

Usage

plot_mds_pca(
  res,
  se,
  var.color = NULL,
  palette = NULL,
  var.shape = NULL,
  shape.values = NULL,
  title = NULL,
  factor = 5,
  ellipse = FALSE,
  ellipse.type = "convex"
)

Arguments

res

List. Output of calculate_mds_pca.

se

RangedSummarizedExperiment-class object

var.color

Character or integer vector. Variable used to determine color. If NULL black color will be used for all samples.

palette

Color palette to be used (default palette from get_palette).

var.shape

Character or integer vector. Variable used to determine shape. If NULL filled circles will be used for all samples.

shape.values

Vector with symbols. Needs to provide a symbol for each unique value of var.shape.

title

Character. Title of the plot. If NULL title will be set based on method.

factor

Numeric. Parameter of the function compute.bagplot. (default: 5)

ellipse

Logical. Should ellipses around points be drawn? (default: FALSE).

ellipse.type

Character. Type of ellipse as given in ggscatter (default: "convex").

Value

List with the following components:

  • info: data.frame with information about outlier samples for each pairwise combination of component sor NULL

  • plot: Plot with three scatterplot as returned by ggarrange

Examples

data("se.gene")

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

## color code by group
plot_mds_pca(res = res.pca,
             se = se.gene,
             var.color = "group")

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