plot_pca_hexbin: PCA hexbin plot

View source: R/scatter.R

plot_pca_hexbinR Documentation

PCA hexbin plot

Description

Computes PCA using one of the methods provided in the Bioconductor package pcaMethods and plots the two first principal components as hexagonal bins, where the value of the coloring variable is summarised for each bin, by default as the mean of the values inside the bin. CITATION: When using this function, cite the pcaMethods package

Usage

plot_pca_hexbin(
  object,
  pcs = c(1, 2),
  all_features = FALSE,
  center = TRUE,
  scale = "uv",
  fill = "Injection_order",
  summary_fun = "mean",
  bins = 10,
  title = "PCA",
  subtitle = NULL,
  fill_scale = getOption("notame.fill_scale_con"),
  ...
)

Arguments

object

a 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 pcaMethods::prep. Default is "uv" for unit variance

fill

character, name of the column used for coloring the hexagons

summary_fun

the function used to compute the value for each hexagon

bins

the number of bins in x and y axes

title, subtitle

the titles of the plot

fill_scale

the fill scale as returned by a ggplot function

...

additional arguments passed to pcaMethods::pca

Value

A ggplot object.

See Also

pca

Examples

plot_pca_hexbin(merged_sample)


antonvsdata/notame documentation built on Sept. 14, 2024, 11:09 p.m.