Plots the trace and/or spectrum for a given peak in peak table.
# S3 method for peak_table
plot(
x,
...,
loc,
chrom_list,
what = "peak",
chr = "max",
lambda = "max",
plot_spectrum = TRUE,
plot_trace = TRUE,
box_plot = FALSE,
vars = NULL,
spectrum_labels = TRUE,
scale_spectrum = FALSE,
export_spectrum = FALSE,
verbose = TRUE
)
If export_spectrum
is TRUE, returns the spectrum as a
data.frame
with wavelengths as rows and columns encoding the
absorbance (or normalized absorbance, if scale_spectrum
is TRUE) for
the specified sample(s). Otherwise, there is no return value.
The peak table (output from get_peaktable
function).
Additional arguments.
The name of the peak or retention time that you wish to plot.
A list of chromatograms in matrix form (timepoints x wavelengths).
What to look for. Either peak
to extract spectral information
for a certain peak, rt
to scan by retention time, or click
to manually
select retention time by clicking on the chromatogram. Defaults to peak
.
Numerical index of chromatogram you wish to plot; "max" to plot the chromatogram with the largest signal; or "all" to plot spectra for all chromatograms.
The wavelength you wish to plot the trace at (if
plot_chrom
is TRUE and/or the wavelength to be used for the determination
of signal abundance.
Logical. If TRUE, plots the spectrum of the chosen peak. Defaults to TRUE.
Logical. If TRUE, plots the trace of the chosen peak at lambda. Defaults to TRUE.
Logical. If TRUE, plots box plot using categories
defined by vars
.
Independent variables for boxplot.
Logical. If TRUE, plots labels on maxima in spectral plot. Defaults to TRUE.
Logical. If TRUE, scales spectrum to unit height. Defaults to FALSE.
Logical. If TRUE, exports spectrum to console. Defaults to FALSE.
Logical. If TRUE, prints verbose output to console. Defaults to TRUE.
If plot_trace
is TRUE, plots the chromatographic trace of the specified
chromatogram (chr
), at the specified wavelength (lambda
) with a
dotted red line to indicate the retention time given by loc
. The
trace is a single column from the chromatographic matrix.
If plot_spectrum
is TRUE, plots the spectrum for the specified chromatogram
at the specified retention time. The spectrum is a single row from the chromatographic
matrix.
If box_plot
is TRUE, produces a boxplot
from the
specified peak with groups provided by vars
.
Ethan Bass
Can be used to confirm the identity of a peak or check that a particular column in the peak table represents a single compound. Can also be used to create simple box-plots to examine the distribution of a peak with respect to variables defined in sample metadata.