14.1 Atom Stereochemistry

The OEAtomBase member function HasStereoSpecified(type) returns a boolean value which indicates whether stereochemical information of a particular type as been stored for an atom. The integer type argument must be a constant listed in the OEAtomStereo namespace. If an atom has associated stereochemistry data, it can be retrieved using the OEAtomBase member function GetStereo(const std::vector<OEAtomBase*>&,unsigned int) function. Multiple possible values may be associated with each class of stereochemistry. For instance, if an atom has associated tetrahedral stereochemistry, the possible values are Undefined, RightHanded (or just Right), or LeftHanded (or just Left). The following code sample demonstrates looping over atoms, testing for atoms which have tetrahedral stereochemistry, and printing out the value of the tetrahedral stereochemistry.

# ch14-1.py
from openeye.oechem import *
import os,sys

mol = OECreateOEMol()
OEParseSmiles(mol, "F[C@H](Cl)Br")

for atom in mol.GetAtoms():
    if atom.HasStereoSpecified(OEAtomStereo_Tetrahedral):
        v= []
        for nbr in atom.GetAtoms():
            v.append(nbr)

        stereovalue = atom.GetStereo(v, OEAtomStereo_Tetrahedral)

        print "Atom:",atom.GetIdx()," "

        if stereovalue == OEAtomStereo_RightHanded:
            print "Right Handed"
        elif stereovalue == OEAtomStereo_LeftHanded:
            print "Left Handed"

The definition of ``handedness'' for tetrahedral stereochemistry does not imply chirality around a tetrahedral center, but rather indicates relative positions of neighboring atoms. Note that the function GetStereo() requires a STL vector containing pointers to the neighboring atoms as the first argument. The ``handedness'' value returned from GetStereo() will depend on the order of the neighboring atoms as they appear in the vector passed to GetStereo(). The definition ``handedness'' in OEChem is demonstrated pictorially in Figure 14-2.

Figure 14-2

Looking down the bond between atom number one and the central atom, handedness is defined as the direction of travel from atom number two to atom number three. The direction of travel must always be along the acute angle formed by atom two, the central atom, and atom three. Right handed and left handed directions of travel can also be though of as clockwise and counterclockwise, respectively. The first neighbor atom in the vector passed to GetStereo() is taken as atom number one determination of ``handedness''. Likewise, subsequent atoms in the neighbor atom vector are assigned sequentially to positions in the ``handedness'' definition. Although, three neighboring atoms are sufficient to determine the ``handedness'' around a trigonal pyramidal or tetrahedral center, either three or four atoms can be provided to the GetStereo() function when requesting a value for tetrahedral chirality.

Setting the relative stereochemistry around a particular center is accomplished using the function SetStereo(AtomVector, type, value). Just as in GetStereo(), the AtomVector of neighbor atoms provide the references about which the handedness is defined. The first of the unsigned integer arguments is the stereochemistry type (i.e. OEAtomStereo_Tetra), and the second is the associated value (i.e. OEAtomStereo_Right).