Loading...
Searching...
No Matches
HydrogenTools Class Reference

## Public Types

enum | Adjustment { Add = 0 , Remove , AddAndRemove }

## Static Public Member Functions

static void | removeAllHydrogens (RWMolecule &molecule)
static void | adjustHydrogens (RWMolecule &molecule, Adjustment adjustment=AddAndRemove)
static void | adjustHydrogens (RWAtom &atom, Adjustment adjustment=AddAndRemove)
static int | valencyAdjustment (const RWAtom &atom)
static int | extraHydrogenIndices (const RWAtom &atom, int numberOfHydrogens, std::vector< size_t > &indices)
static void | generateNewHydrogenPositions (const RWAtom &atom, int numberOfHydrogens, std::vector< Vector3 > &positions)

## Member Enumeration Documentation

## Adjustment

enum Adjustment

Enum values that control the adjustHydrogen function's behavior.

Enumerator
Add | Only add hydrogens to underbonded atoms.
Remove | Only remove hydrogens from overbonded atoms.
AddAndRemove | Add hydrogens to underbonded atoms and remove hydrogens from overbonded atoms.

## Member Function Documentation

## removeAllHydrogens()

void removeAllHydrogens | ( | RWMolecule & | molecule | ) |

static

Remove all hydrogen atoms from molecule.

## adjustHydrogens() [1/2]

void adjustHydrogens | ( | RWMolecule & | molecule,
|  | Adjustment | adjustment = AddAndRemove )

static

Add/remove hydrogens on molecule to satisfy valency.

## adjustHydrogens() [2/2]

void adjustHydrogens | ( | RWAtom & | atom,
|  | Adjustment | adjustment = AddAndRemove )

static

Add/remove hydrogens on atom to satisfy valency.

## valencyAdjustment()

int valencyAdjustment | ( | const RWAtom & | atom | ) |

static

Returns
  The number of bonds that need to be added or removed from atom to satisfy valency. A positive number indicates the number of bonds to add, a negative number indicates the number of bonds that need to be removed.

## extraHydrogenIndices()

int extraHydrogenIndices | ( | const RWAtom & | atom,
|  | int | numberOfHydrogens,
|  | std::vector< size_t > & | indices )

static

Obtain the indices of hydrogens that can be removed from atom.

Parameters

  atom | The atom from which to prune hydrogens.
  numberOfHydrogens | The maximum number of hydrogens to prune.
  indices | A vector that will be appended with the indices of the hydrogens to remove.

Returns
  The number of hydrogen indices appended to indices.

Note
  This function modifies neither atom nor its parent molecule. It only pushes the indices of hydrogens to remove to the end of indices.

## generateNewHydrogenPositions()

void generateNewHydrogenPositions | ( | const RWAtom & | atom,
|  | int | numberOfHydrogens,
|  | std::vector< Vector3 > & | positions )

static

Generate positions for numberOfHydrogens hydrogens bonded to atom.

Parameters

  positions | Vector of positions that will be appended with numberOfHydrogens hydrogen locations.

Note
  There is nothing intelligent going on here. The new positions are randomly oriented and have a length that is the sum of atom's and hydrogen's covalent radii. Effort is made to prevent overlap with other bonded atoms, but this is not guaranteed.

The documentation for this class was generated from the following file:

- hydrogentools.h