adductMatch.massdiff: Report closest-matching adduct type for a list of mass...

Description Usage Arguments Details Value See Also Examples

View source: R/adductMatch.massdiff.R

Description

Given a set of mass differences produced by function massdiff, report for each pair of masses the closest-matching molecular transformation from a list of such potential adduct types. The built-in data sets adducts and adducts2 are examples of such lists of potential adducts.

Usage

1
2
3
## S3 method for class 'massdiff'
adductMatch(x, add = mass2adduct::adducts, ppm = 2,
  mDa = NULL)

Arguments

x

massdiff; Mass differences produced by massdiff

add

data.frame of adduct masses (default: "adducts" dataset in package)

ppm

numeric; the peak width (uncertainty) of the calculated peaks in proportional units, as parts per million (default: 2)

mDa

numeric; the peak width (uncertainty) of the calculated peaks in absolute mass units, as milliDaltons (default: NULL)

Details

There are two options for setting a cutoff to match a given mass to a given potential adduct. The cutoff can be either proportional to the mass (and expressed as parts per million ppm) or a flat absolute value (in milliDaltons mDa). ppm is used by default. If a value for mDa is specified, then any value given to ppm is ignored. The ppm or mDa values are usually reported by the peak-picking software used.

Value

Object of class massdiff, with additional element "matches" reporting the closest matches

See Also

adductMatch.massdiffhist gives an overview for large data sets by matching closest adducts to mass differences already binned into a histogram.

topAdducts to find the closest-matching adducts for the mass differences with the highest counts (the converse of the current function)

Examples

1
2
3
d <- msimat(csv=system.file("extdata","msi.csv",package="mass2adduct"),sep=";")
d.diff <- massdiff(d) # Calculate mass differences from imported MSI data
d.diff.annotate <- adductMatch(d.diff,add=adducts2) # Report closest matches

kbseah/mass2adduct documentation built on June 9, 2021, 9:20 p.m.