Learn R Programming

ume (version 1.5.2)

uplot_ms: Plot Mass Spectrum

Description

Plots the mass spectrum, showing magnitude versus mass-to-charge ratio (m/z). Optionally reduces the data by selecting the top data_reduction most abundant peaks per spectrum.

Usage

uplot_ms(
  pl,
  mass = "mz",
  peak_magnitude = "i_magnitude",
  label = "file_id",
  logo = FALSE,
  plotly = TRUE,
  data_reduction = 1,
  ...
)

Value

A ggplot (class "ggplot") or plotly (class "htmlwidget") object representing the mass spectrum.

Arguments

pl

A data table that must contain columns for mass-to-charge ratio and peak magnitude (could be peak list or molecular formula data).

mass

Character. Name of the column containing mass-to-charge or mass information (default = "mz").

peak_magnitude

Character. Name of the column containing (relative) peak magnitude information (default = "i_magnitude").

label

Character. Name of the column containing the names of the mass spectra to be displayed (default = "file_id").

logo

Logical. If TRUE, adds a UME caption.

plotly

Logical. If TRUE, return interactive plotly object.

data_reduction

Numeric. The percentage of the most abundant peaks to select per spectrum. This value should be between 0 and 1 (default = 1, which means all data will be displayed). If set to 0, no data reduction will occur, but a minimum value of 0.01 will be used to ensure some data is displayed.

...

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_lcms(), uplot_ma_vs_mz(), uplot_n_mf_per_sample(), uplot_pca(), uplot_ratios(), uplot_reproducibility(), uplot_ri_vs_sample(), uplot_vk()

Examples

Run this code
uplot_ms(pl = peaklist_demo, data_reduction = 0.1, plotly = TRUE)
uplot_ms(pl = peaklist_demo, data_reduction = 1, plotly = FALSE)

Run the code above in your browser using DataLab