Skip to contents

Like [plot_TRACE_labeling_fraction()], but accepts nutrient `sample.type` groups (for example `NSA`–`NSH`) instead of the four standard TRACE tracer groups. Labeling fraction is computed as CxNy / total (same numerator as the `S13C15N` group in [plot_TRACE_labeling_fraction()]).

Usage

plot_TRACE_labeling_fraction_nutrients(
  object,
  i.pol = 0,
  nutrient.groups = c("NSA", "NSB", "NSC", "NSD", "NSE", "NSF", "NSG", "NSH"),
  nutrient.labels = NULL,
  nutrient.colors = NULL,
  TRACE_cor_cutoff = 0.7,
  return.data = FALSE
)

Arguments

object

MSdev object with TRACE results in `object@advancedAna$TRACE` or legacy `object@statData$TRACE`.

i.pol

Polarity index. `0` for negative and `1` for positive.

nutrient.groups

Character vector of nutrient `sample.type` values to include.

nutrient.labels

Optional named character vector mapping nutrient group codes to x-axis labels.

nutrient.colors

Optional named character vector of colors for nutrient groups. Default uses the standard eight-group nutrition palette.

TRACE_cor_cutoff

Minimum `TRACE_cor` used to select CN seeds when TRACE metabolite annotations are unavailable.

return.data

Logical. If `TRUE`, return a list with `plot` and `data`.

Value

A patchwork object combining the boxplot and density plot, or a list with `plot`, `p1`, `p2`, and `data` when `return.data = TRUE`.