Seperate an ordered vector of M/Z value into distinct groups with similar M/Z by finding gaps of greater than cutoff

find_mz_jumps(
  sorted_mzs,
  mass_accuracy_tolerance,
  absolute_or_relative,
  n_max_gap_inconsistencies = 0L,
  collapse = TRUE
)

Arguments

sorted_mzs

numeric vector of m/z values

mass_accuracy_tolerance
  • If absolute_or_relative == "relative": minimum fractional mass tolerance (m/z * tol) between consecutive m/z values that indicates to start a new M/Z group

  • If absolute_or_relative == "absolute": minimum mass tolerance (Da) between consecutive m/z values that indicates to start a new M/Z group

absolute_or_relative

Indicate whether the specified mass_accuracy_tolerance is "relative" or "absolute"

n_max_gap_inconsistencies

Maximum number of observations of an mz-value to ignore when find breaks between common mzs (i.e., group A & B are seperate if there are <= n_max_gap_inconsistencies mzs within the tolerance between them)

collapse
  • If collapse == TRUE return mappings between each unique sorted_mz and mz_set

  • If collapse == FALSE return a vector of mz_sets aligned to the sorted_mzs

Value

a tibble containing paired mz and mz_set (mz groupings)