Learn R Programming

rcdk (version 3.4.7.2)

Molecule: Operations on molecules

Description

Various functions to perform operations on molecules.

get.exact.mass returns the exact mass of a molecule

get.natural.mass returns the natural exact mass of a molecule

convert.implicit.explicit converts implicit hydrogens to explicit hydrogens. This function does not return any value but rather modifies the molecule object passed to it

is.neutral returns TRUE if all atoms in the molecule have a formal charge of 0, otherwise FALSE

Usage

get.exact.mass(molecule)
get.natural.mass(molecule)
convert.implicit.to.explicit(molecule)
is.neutral(molecule)

Arguments

molecule

A jObjRef representing an IAtomContainer or IMolecule object

Value

exact.mass returns a numeric

get.natural.mass returns a numeric

convert.implicit.to.explicit has no return value

is.neutral returns a boolean.

Details

In some cases, a molecule may not have any hydrogens (such as when read in from an MDL MOL file that did not have hydrogens). In such cases, convert.implicit.to.explicit will add implicit hydrogens and then convert them to explicit ones. In addition, for such cases, make sure that the molecule has been typed beforehand.

See Also

get.atoms, do.typing

Examples

Run this code
# NOT RUN {
  m <- parse.smiles('c1ccccc1')[[1]]

  ## Need to configure the molecule
  do.aromaticity(m)
  do.typing(m)
  do.isotopes(m)

  get.exact.mass(m)
  get.natural.mass(m)

  convert.implicit.to.explicit(m)
  get.natural.mass(m) 
  do.isotopes(m) # Configure isotopes of newly added hydrogens
  get.exact.mass(m)

  is.neutral(m)
# }

Run the code above in your browser using DataLab