Skip to contents

Relative log abundance (RLA) plots show standardized feature abundances across samples. Standardization is done by removing either the within-batch or across-batch median from each feature

RLA plots are useful for visualizing technical effects that impact all features in a similar manner, such as batch effects due to changes in instrument response, pipetting errors, or sample spillage. Unlike plots of raw or normalized abundances, RLA plots are more robust to these types of effects.

Usage

plot_rla_boxplot(
  data = NULL,
  rla_type_batch = c("within", "across"),
  variable = c("intensity", "norm_intensity", "conc", "conc_raw", "area", "height",
    "fwhm"),
  filter_data = FALSE,
  qc_types = NA,
  x_axis_variable = c("run_seq_num"),
  include_feature_filter = "",
  exclude_feature_filter = "",
  plot_range_indices = NA,
  min_feature_intensity = 0,
  y_lim = NA,
  ignore_outliers = FALSE,
  show_batches = TRUE,
  batches_as_shades = FALSE,
  batch_line_color = "#b6f0c5",
  batch_shading_color = "grey93",
  x_gridlines = FALSE,
  linewidth = 0.2,
  base_font_size = 8,
  relative_log_abundances = TRUE
)

Arguments

data

MidarExperiment

rla_type_batch

Character, must be either "within" or "across", defining whether to use within-batch or across-batch RLA

variable

Variable to plot, must be one of "intensity", "norm_intensity", "conc", "conc_raw", "area", "height", "fwhm".

filter_data

Logical, whether to use QC-filtered data

qc_types

QC type(s) to plot. Can be a vector of QC types or NA/NULL to plot all available QC types.

x_axis_variable

Character, variable to use for the x-axis. Must be one of: "run_seq_num", "run_no", "analysis_id", or "timestamp"

include_feature_filter

Regex pattern to select specific features

exclude_feature_filter

Regex pattern to exclude specific features

plot_range_indices

Numeric vector of length 2, specifying the start and end indices of the sequence to be plotted. NA plots all samples.

min_feature_intensity

Numeric, exclude features with overall median signal below this value

y_lim

Numeric vector of length 2, specifying the lower and upper y-axis limits. Default is NA, which uses limits calculated based on ignore_outliers.

ignore_outliers

Logical, whether to exclude outlier values based on 4x MAD (median absolute deviation) fences

show_batches

Logical, whether to show batch separators in the plot

batches_as_shades

Logical, whether to show batches as shaded areas instead of line separators

batch_line_color

Character, color of the batch separator lines

batch_shading_color

Character, color of the batch shaded areas

x_gridlines

Logical, whether to show major x-axis gridlines

linewidth

Numeric, line width used for whiskers of the boxplot

base_font_size

Numeric, base font size for the plot

relative_log_abundances

Logical, whether to use relative log abundances (RLA) or just log-transformed values

Value

A ggplot object representing the RLA plot

References

De Livera et al. (2012) Normalizing and integrating metabolomics data. Analytical Chemistry 10768-10776 DOI: 10.1021/ac302748b De Livera et al. (2015) Statistical Methods for Handling Unwanted Variation in Metabolomics Data. Analytical Chemistry 87(7):3606-3615 DOI: 10.1021/ac502439y