Learn R Programming

rcdk (version 3.1.8.1)

generate.formula: Generate a cdkFormula object.

Description

This function generate a list of cdkFormula objects given a mass.

Usage

generate.formula(mass, window=0.01, elements=list(c("C",0,50),c("H",0,50),c("N",0,50),c("O",0,50),c("S",0,50)), validation=FALSE, charge=0.0)

Arguments

mass
The mass value from which to be generate the formulas.
window
The window accuracy in the same units as mass.
elements
Elements to take into account.
validation
TRUE, if the method should only generate valid formulas. If FALSE, nonsensical formulae my be generated which must be filtered out by the user
charge
The charge value of the formula.

Value

  • Objects of class MassToFormulaTool, from the IMolecularFormula package

See Also

get.formula, set.charge.formula, get.isotopes.pattern, isvalid.formula

Examples

Run this code
mfSet <- generate.formula(18.03383,charge=1,elements=list(c("C",0,50),c("H",0,50),c("N",0,50)))
for (i in mfSet) {
  print(i)
}

Run the code above in your browser using DataLab