Periodic Table Functions

To simplify the task of dealing with the elements of the periodic table, OEChem TK contains several functions to obtain useful properties of the elements.

Atomic Symbol/Atomic Number

A common task is to obtain or display the atomic symbol of an atom represented by an OEAtomBase. To save space and reduce redundancy and consistency issues, the OEAtomBase class contains only an unsigned integer representing the atom’s atomic number. This value may be obtained using the OEAtomBase::GetAtomicNum method. This value can be converted into an atomic symbol using the OEGetAtomicSymbol function.

const char *symb = OEGetAtomicSymbol(OEElemNo::C);
cout << "The atomic symbol for carbon is " << symb << endl;

The example above uses the integer constant OEElemNo::C from the OEElemNo namespace. This namespace represents the atomic numbers of the 111 elements as their symbols as a convenience.

The inverse of OEGetAtomicSymbol, i.e. obtaining the atomic numbers from an atomic symbol, is performed by the OEGetAtomicNum function.

cout << "The atomic number for 'Cl' is " << OEGetAtomicNum("Cl") << endl;

Element Properties

OEChem TK provides several functions for obtaining properties of the elements, all of which take an unsigned integer argument representing the element’s atomic number.

Property Name

Return Value

Function

Average Atomic Weight

double

OEGetAverageWeight

Most Abundant Isotope

unsigned int

OEGetDefaultMass

The OEChem TK library also provides the following two functions to deal with specific isotopes:

Both functions take an unsigned integer representing the isotope’s atomic number (number of protons), and an unsigned integer representing the isotope’s mass (number of protons plus neutrons).

The following example shows how to calculate molecular weight (OECalculateMolecularWeight) :

double CalculateMolecularWeight(const OEMolBase &mol)
{
  unsigned int implicitH = 0u;
  double weight = 0.0;

  for (OEIter<const OEAtomBase> atom = mol.GetAtoms(); atom; ++atom)
  {
     const auto elemno = atom->GetAtomicNum();
     const auto mass = atom->GetIsotope();
     implicitH += atom->GetImplicitHCount();
     if ((elemno != 0u) && (mass != 0u) && OEIsCommonIsotope(elemno, mass))
        weight += OEGetIsotopicWeight(elemno, mass);
      else
        weight += OEGetAverageWeight(elemno);
  }
  weight += (implicitH * OEGetAverageWeight(OEElemNo::H));
  return weight;
}

Atom Radius Functions

Property Name

Get Method

Applied on OEMolBase

Reference

Covalent Radius

OEGetCovalentRadius

OEAssignCovalentRadii

Default Radius used by DelPhi

OEGetDelphiRadius

OEAssignDelphiRadii

Accelrys

Effective Ionic Radius

OEGetHonigIonicCavityRadius

OEAssignHonigIonicCavityRadii

[Rashin-1985]

Van der Waals Radius

OEGetBondiVdWRadius

OEAssignBondiVdWRadii

[Bondi-1964]

Van der Waals Radius

OEGetPaulingVdWRadius

OEAssignPaulingVdWRadii

[Pauling-1960]

Van der Waals Radius

N/A [1]

OEAssignZap9Radii

[Nicholls-2008]

Van der Waals Radius

OEAssignZap7Radii

[Nicholls-2010]

Generic Assignment Function

N/A [2]

OEAssignRadii

Table footnote:

[1] The get method is not available, since the radius value of OEElemNo::O and OEElemNo::N (defined in [Nicholls-2008]) depend on the chemical environment of the given atom.

[2] Can be used to call any of the other methods to assign radii as well as to clear atomic radii.

The following snippet shows how to set and access the “Pauling” van der Waals radius in a given OEMolBase:

OEGraphMol mol;
OESmilesToMol(mol, "c1ccncc1CF");
OEAssignPaulingVdWRadii(mol);
for (OEIter<const OEAtomBase> atom = mol.GetAtoms(); atom; ++atom)
  cout << atom->GetIdx() << ' ' << atom->GetRadius() << endl;
../_images/OEAssignPaulingVdWRadii.png

Example of setting “Pauling” van der Waals radius