MBoxplot: MBoxplot.

View source: R/MBoxplot.R

MBoxplotR Documentation

MBoxplot.

Description

MBoxplot will generate an annotated boxplot. A unifying function for MS-data Boxplots based on \'raw\' and \'sam\'.

Usage

MBoxplot(
  pk = pk,
  raw = NULL,
  sam = NULL,
  met = NULL,
  g = NULL,
  flt = NULL,
  an = NULL,
  plot_sample_n = FALSE,
  txt = NULL,
  cex.txt = 0.5,
  plot_rel_axis = NULL,
  ...
)

Arguments

pk

Colname of raw to plot if pk is character OR the colnum number if pk is numeric.

raw

Plotting data as samples (rows) x metabolites (cols).

sam

Sample table.

met

Containing at minimum columns for annotation (see parameter an) and nrow(met) should be ncol(raw).

g

Grouping vector if Group not contained in sam.

flt

Filter to exclude certain samples (T/F) vector.

an

Switch to include annotation (from met) in the boxplot providing a character vector of colnames from met.

plot_sample_n

Amend each box with the number of finite values which were a basis for plotting this group.

txt

Character vector with information per sample to be plotted on top of the box as text.

cex.txt

Specify size of annotation text.

plot_rel_axis

Specify one level of g (or sam$Group) which to express the data relative against.

...

Further options parsed to boxplot.

Details

Usually metabolomics experiments are conducted on multiple replicates of a sample group. Boxplots allow to quickly access potential differences between measurement values of several groups. MBoxplot can be nicely used to generate QC plots for all metabolites prior and after normalization, in absolute or relative scale and sorted according to significance.

Value

Nothing. Will produce a plot (or file if specified).

Examples

x <- data.frame("y" = runif(36), "GT" = gl(3, 12), "TP" = factor(rep(rep(1:3, each = 4), 3)))
x <- cbind(x, AdjustSymbols(cols = x$GT, pchs = x$TP))
MBoxplot(
  pk = "y", raw = x, sam = x, met = data.frame("Peak" = "y", "Test" = I("info")),
  g = interaction(x$GT, x$TP), an = "Test", plot_n_samples = TRUE, txt = rownames(x)
)

MetabolomicsBasics documentation built on May 29, 2024, 9:02 a.m.