plot_mds_pca_2d: MDS or PCA plot (2D)

View source: R/plot_mds_pca.R

plot_mds_pca_2dR Documentation

MDS or PCA plot (2D)

Description

Plots two specified 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_2d(
  res,
  dim = c(1, 2),
  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. calculate_mds_pca.

dim

Numeric vector (2). Numbers of components to be plotted.

se

RangedSummarizedExperiment-class object

var.color

Character. Name of variable used to determine color. If NULL black color will be used for all samples.

palette

Color palette to be used (default palette used in ggscatter).

var.shape

Character. Name of 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. Main title of plot.

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 or NULL

  • plot: Scatterplot as returned by ggscatter

Examples

data("se.gene")

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

## color code by group
plot_mds_pca_2d(res = res.pca,
                dim = c(1, 2),
                se = se.gene,
                var.color = "group")

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