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,
include_qualifier = TRUE,
include_istd = TRUE,
include_feature_filter = NA,
exclude_feature_filter = NA,
plot_range = NA,
show_timestamp = FALSE,
min_feature_intensity = 0,
y_lim = NA,
ignore_outliers = FALSE,
show_batches = TRUE,
batch_zebra_stripe = FALSE,
batch_line_color = "#b6f0c5",
batch_fill_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", "area", "height", "fwhm", or one of "intensity_raw", "intensity_before", "norm_intensity_raw", "norm_intensity_before", "conc_raw", "conc_before"
- filter_data
Logical, whether to use QC-filtered data based on criteria set via
filter_features_qc()
.- qc_types
QC types to be plotted. Can be a vector of QC types or a regular expression pattern.
NA
(default) displays all available QC/Sample types.- include_qualifier
Logical, whether to include qualifier features. Default is
TRUE
.- include_istd
Logical, whether to include internal standard (ISTD) features. Default is
TRUE
.- include_feature_filter
A regex pattern or a vector of feature names used to filter features by
feature_id
. IfNA
or an empty string (""
) is provided, the filter is ignored. When a vector of length > 1 is supplied, is supplied, only features with exactly these names are selected (applied individually as OR conditions).- exclude_feature_filter
A regex pattern or a vector of feature names to exclude features by feature_id. If
NA
or an empty string (""
) is provided, the filter is ignored. When a vector of length > 1 is supplied, is supplied, only features with exactly these names are excluded (applied individually as OR conditions).- plot_range
Numeric vector of length 2, specifying the start and end indices of the analysis order to be plotted.
NA
plots all samples.- show_timestamp
Logical, whether to use the acquisition timestamp as the x-axis instead of the run sequence number
- 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 onignore_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
- batch_zebra_stripe
Logical, whether to show batches as shaded areas instead of line separators
- batch_line_color
Character, color of the batch separator lines
- batch_fill_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
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