Skip to contents

Computes PCA using one of the methods provided in the Bioconductor package pcaMethods and plots the loadings of first principal components.

Usage

plot_pca_loadings(
  object,
  pcs = c(1, 2),
  all_features = FALSE,
  center = TRUE,
  scale = "uv",
  n_features = c(10, 10),
  title = "PCA loadings",
  subtitle = NULL,
  text_base_size = 14,
  point_size = 2,
  label_text_size = 4,
  assay.type = NULL,
  ...
)

Arguments

object

a SummarizedExperiment or MetaboSet object

pcs

numeric vector of length 2, the principal components to plot

all_features

logical, should all features be used? If FALSE (the default), flagged features are removed before visualization.

center

logical, should the data be centered prior to PCA? (usually yes)

scale

scaling used, as in prep. Default is "uv" for unit variance

n_features

numeric vector of length two, number of top feature to plot for each principal component

title, subtitle

the titles of the plot

text_base_size

numeric, base size for text

point_size

numeric, size of the points

label_text_size

numeric, size of the labels

assay.type

character, assay to be used in case of multiple assays

...

additional arguments passed to prep

Value

A ggplot object.

See also

Examples

data(example_set)
plot_pca_loadings(example_set, n_features = c(2, 4))