This function generates scatter plots comparing two QC metrics variables
across feature classes. A list of available QC metrics is available from the
calc_qc_metrics()
documentation.
Arguments
- data
A
MidarExperiment
object containing pre-calculated QC metrics.- x_variable
The name of the QC metric variable to be plotted on the x-axis.
- y_variable
The name of the QC metric variable to be plotted on the y-axis.
- facet_by_class
If
TRUE
, facets the plot byfeature_class
, as defined in the feature metadata.- filter_data
Logical; whether to use all data (default) or only QC-filtered data (filtered via
filter_features_qc()
).- include_qualifier
Logical; whether to include qualifier features (default is
TRUE
).- equality_line
Logical; whether to show a line indicating identical values in both compared variables (default is
FALSE
).- threshold_value
Numeric; threshold value to be shown as dashed lines from both axes on the plot (default is
NA
).- xlim
Numeric vector of length 2 for x-axis limits. Use
NA
for auto-scaling (default isc(0, NA)
).- ylim
Numeric vector of length 2 for y-axis limits. Use
NA
for auto-scaling (default isc(0, NA)
).- ncol
Integer; number of facet columns per page (default is
5
).- point_size
Numeric; size of points in millimeters (default is
1
).- point_alpha
Numeric; transparency of points (default is
0.5
).- font_base_size
Numeric; base font size in points (default is
8
).
Details
x_variable
andy_variable
must be available in the QC metrics table. Please refer to the help page ofcalc_qc_metrics()
for more information on the available QC metric variables.When
facet_by_class = TRUE
, then thefeature_class
must be defined in the metadata or retrieved via specific functions, e.g.,get_lipid_class_names()
.
Examples
# Example usage
mexp <- lipidomics_dataset
mexp <- calc_qc_metrics(mexp)
plot_qcmetrics_comparison(data = mexp,
filter_data = FALSE,
x_variable = "precursor_mz",
y_variable = "rt_median_SPL",
include_qualifier = TRUE)