Objects from this class are used to specify adduct information in an algorithm independent way.
Usage
adduct(...)
# S4 method for class 'adduct'
show(object)
# S4 method for class 'adduct'
as.character(x, format = "generic", adductInfo = NULL, err = TRUE)Arguments
- x, object
An
adductobject.- format
A
characterthat 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 bySIRIUS. It is similar togenericbut 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 theGenFormAdductsandMetFragAdductsfunctions, respectively."openms"is the format used by theMetaboliteAdductDechargertool."cliquems"is the format used by cliqueMS."nontarget"is the format used by nontarget/enviPat and requiresadductInfoto be set.- adductInfo
A
data.framewith adduct info from e.g. enviPat::adducts. Only needs to be set whenformat="nontarget".- err
If
TRUEthen an error will be thrown if conversion fails, otherwise returns without data.- ...
Any of
add,sub,molMultand/orcharge. SeeSlots.
Methods (by generic)
show(adduct): Shows summary information for this object.as.character(adduct): Converts anadductobject to a specifiedcharacterformat.
Slots
add,subA
characterwith 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).
See also
as.adduct for easy creation of adduct objects
and adduct utilities for other adduct functionality.
Examples
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]+"