Learn R Programming

nontarget (version 1.9)

adduct.search: Detecting and grouping adduct m/z relations among peaks in a HRMS dataset

Description

Algorithm for detecting m/z differences among peaks that may correspond to m/z differences among different adducts.

Usage

adduct.search(peaklist, adducts, rttol = 0, mztol = 2,ppm = TRUE, use_adducts = c("M+H", "M+K", "M+Na"), ion_mode = "positive")

Arguments

peaklist
Dataframe of HRMS peaks with three numeric columns for (a) m/z, (b) intensity and (c) retention time, such as peaklist.
adducts
Data.frame adducts or equivalent.
rttol
Retention time tolerance. Units as given in column 3 of peaklist argument, e.g. [min].
mztol
m/z tolerance setting: value by which the m/z of a peak may vary from its expected value. If parameter ppm=TRUE (see below) given in ppm, otherwise, if ppm=FALSE, in absolute m/z [u]. Defines the "large" mass tolerance used.
ppm
Should mztol be set in ppm (TRUE) or in absolute m/z (FALSE)
use_adducts
Vector of adducts to be screened for. Corresponds to names in the first column of adducts, thus referring to equations from the second column of adducts to be used for calculating adduct m/z differences.
ion_mode
"positive" or "negative".

Value

List of type adduct with 5 entries

Details

Given a peak from the peaklist, the adduct.search algorithm screens within tolerances mztol and rttol whether any other peaks may correspond to this one peak via adduct m/z differences. More precisely, the one peak m/z is reset to all possible candidate molecular mass values (M; uncharged, non-adduct). The latter are then used to calculate for all other candidate adduct peaks, which, if found, are subsequently grouped.

For example, consider use_adducts=c("M+H", "M+K"). Given the m/z-value of the one peak, two other peaks with ((m/z*z("M+H")-X("M+H"))/z("M+K"))+X("M+K") and ((m/z*z("M+K")-X("M+K"))/z("M+H"))+X("M+H") are searched for. The peak found for the first term (i.e. with "M+H" being the candidate adduct of the one peak) leads to one group of associated adduct peaks (M+H<->M+K). Another adduct peak (i.e. with "M+K" being the candidate adduct of the one peak) would lead to a second group of associated adduct peaks (M+K<->M+H). Logically, larger adduct groups than the one exemplified can be present, if argument "use_adducts" allows for it (e.g. M+H<->M+K,M+H<->M+Na,M+Na<->M+K).

See Also

rm.sat adducts peaklist plotadduct combine plotgroup

Examples

Run this code

######################################################
# load required data: ################################
# HRMS peak list: ####################################
data(peaklist)
# list of adducts ####################################
data(adducts) 
######################################################
# run grouping of peaks for different adducts ########
# of the same candidate molecule #####################
adduct<-adduct.search(
  peaklist,
  adducts,
  rttol=0.05,
  mztol=3,
  ppm=TRUE,
  use_adducts=c("M+K","M+H","M+Na","M+NH4"),
  ion_mode="positive"
);
# plot results #######################################
plotadduct(adduct);
######################################################

Run the code above in your browser using DataLab