Annotate isotopes within feature groups
Source:R/AllGenerics.R, R/methods-numeric.R, R/methods-XcmsExperiment.R
annotateIsotopes.RdannotateIsotopes() labels isotope patterns within each feature group in
CAMERA syntax: "[3][M]+" is the monoisotopic peak of pattern 3,
"[3][M+1]+" its first isotopologue, and so on. Features that are not
part of a pattern get "".
Usage
annotateIsotopes(object, param, ...)
# S4 method for class 'numeric,IsotopologueParam'
annotateIsotopes(object, param, intensity, groups, ...)
# S4 method for class 'XcmsExperiment,IsotopologueParam'
annotateIsotopes(object, param, ...)Arguments
- object
For the
numericmethod: the m/z values of the features. For theXcmsExperimentmethod: an xcms::XcmsExperiment with feature groups (seeMsFeatures::groupFeatures()).- param
An IsotopologueParam object.
- ...
ignored.
- intensity
numeric, for thenumericmethod only: one representative intensity per feature, e.g. the median over the study samples.- groups
for the
numericmethod only: one group label per feature.
Value
For the numeric method a character vector with one label per
feature. For the XcmsExperiment method the object, with the labels in
the isotopes column of featureDefinitions() and the parameters in
metadata(object)$IonFamilies$isotopes.
Examples
## Ions of 2-furoylglycine (M = 169.0375) in one feature group
mz <- c(95.0124, 124.0392, 152.0342, 170.0445, 171.0496, 192.0275,
377.0300, 393.0019)
int <- c(71.6, 81.4, 49.8, 100, 4.33, 11.3, 1.76, 1.82)
annotateIsotopes(mz, IsotopologueParam(), intensity = int,
groups = rep("FG.1", 8))
#> [1] "" "" "" "[1][M]+" "[1][M+1]+" ""
#> [7] "" ""