Objects from this class are used to specify adduct information in an algorithm independent way.
adduct(...)
# S4 method for class 'adduct'
show(object)
# S4 method for class 'adduct'
as.character(x, format = "generic", err = TRUE)An adduct object.
A character that specifies the source format.
"generic" is an internally used generic format that supports full
textual conversion. Examples: "[M+H]+", "[2M+H]+",
"[M+3H]3+".
"sirius" Is the format used by SIRIUS. It is similar to
generic but does not allow multiple charges/molecules. See the
SIRIUS manual for more details.
"genform" and "metfrag" support fixed types of adducts
which can be obtained with the GenFormAdducts and
MetFragAdducts functions, respectively.
"openms" is the format used by the MetaboliteAdductDecharger tool.
"cliquems" is the format used by cliqueMS.
If TRUE then an error will be thrown if conversion fails,
otherwise returns without data.
Any of add, sub, molMult and/or charge. See Slots.
show(adduct): Shows summary information for this object.
as.character(adduct): Converts an adduct object to a specified
character format.
add,subA character with one or more formulas to add/subtract.
molMultHow many times the original molecule is present in this molecule (e.g. for a dimer this would be 2). Default is 1.
chargeThe final charge of the adduct (default 1).
as.adduct for easy creation of adduct objects
and adduct utilities for other adduct functionality.
adduct("H") # [M+H]+
adduct(sub = "H", charge = -1) # [M-H]-
adduct(add = "K", sub = "H2", charge = -1) # [M+K-H2]+
adduct(add = "H3", charge = 3) # [M+H3]3+
adduct(add = "H", molMult = 2) # [2M+H]+
as.character(adduct("H")) # returns "[M+H]+"