Learn R Programming

ume (version 1.5.2)

uplot_lcms: Plot LC-MS Spectrum (or fallback MS if no RT available)

Description

Creates a 3D LC–MS plot (RT x m/z x intensity) when retention time is available. If no retention-time column exists (e.g., with DI-FTMS demo data), the function gracefully falls back to uplot_ms() and issues an informative message.

Usage

uplot_lcms(
  pl,
  mass = "mz",
  peak_magnitude = "i_magnitude",
  retention_time = "ret_time_min",
  label = "file_id",
  logo = FALSE,
  ...
)

Value

A plotly 3D visualization (LC-MS) or a 2D MS spectrum fallback.

Arguments

pl

data.table containing peak data. Mandatory columns include neutral molecular mass (mass), peak magnitude (i_magnitude), and a peak identifier (peak_id).

mass

Column containing m/z values (default "mz").

peak_magnitude

Column containing intensity (default "i_magnitude").

retention_time

Column with retention time (default "ret_time_min").

label

Sample/group labeling column (default "file_id").

logo

Logical. If TRUE, adds a UME caption.

...

Additional arguments passed to methods.

See Also

Other plots: uplot_cluster(), uplot_cvm(), uplot_dbe_minus_o_freq(), uplot_dbe_vs_c(), uplot_freq_ma(), uplot_freq_vs_ppm(), uplot_hc_vs_m(), uplot_heteroatoms(), uplot_isotope_precision(), uplot_kmd(), uplot_ma_vs_mz(), uplot_ms(), uplot_n_mf_per_sample(), uplot_pca(), uplot_ratios(), uplot_reproducibility(), uplot_ri_vs_sample(), uplot_vk()