Learn R Programming

ume (version 1.5.2)

uplot_hc_vs_m: H/C vs Molecular Mass Plot

Description

Creates a scatter plot of the hydrogen-to-carbon ratio (H/C) versus molecular mass (nm). Points are color-coded according to a selected intensity or property column (int_col). This visualization follows the conceptual design in Schmitt-Kopplin et al. (2010).

The function can optionally add a branding label ("UltraMassExplorer") and can optionally return an interactive Plotly version of the plot.

Usage

uplot_hc_vs_m(
  df,
  int_col = "norm_int",
  palname = "redblue",
  size_dots = 1.2,
  gg_size = 12,
  logo = TRUE,
  plotly = FALSE,
  ...
)

Value

A ggplot2 scatter plot, or a plotly object if plotly = TRUE.

Arguments

df

A data.table containing columns:

  • nm: molecular mass

  • hc: hydrogen-to-carbon ratio

  • int_col: the column used for color-coding

int_col

Character, column used for color-coding. Default "norm_int".

palname

Character, palette name passed to f_colorz().

size_dots

Numeric. Size of the dots in the plot (default = 0.5).

gg_size

Base text size for theme_uplots(). Default = 12.

logo

Logical. If TRUE, adds a UME caption.

plotly

Logical. If TRUE, return interactive plotly object.

...

Arguments passed on to f_colorz

z

Numeric vector. Values whose colors should be computed.

col_num

Integer. Number of colors in the palette (default: 100).

verbose

logical; if TRUE, show progress messages.

tf

Logical. If TRUE, applies a transformation to the color scale (default is FALSE).

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_heteroatoms(), uplot_isotope_precision(), uplot_kmd(), uplot_lcms(), uplot_ma_vs_mz(), uplot_ms(), uplot_n_mf_per_sample(), uplot_pca(), uplot_ratios(), uplot_reproducibility(), uplot_ri_vs_sample(), uplot_vk()

Examples

Run this code
uplot_hc_vs_m(mf_data_demo, int_col = "norm_int")

Run the code above in your browser using DataLab