Atom Properties

The OEAtomBase class is the workhorse of the OEChem TK library, representing the atoms of a molecule. This section details some of its important and often used properties and methods.

Read/Write Atom Properties

Property Name Type Get Method Set Method See Also
Atomic Number unsigned int GetAtomicNum SetAtomicNum  
Formal Charge int GetFormalCharge SetFormalCharge Formal Charges
Implicit Hyd. Count unsigned int GetImplicitHCount SetImplicitHCount
Isotopic Mass unsigned int GetIsotope SetIsotope  
Partial Charge double GetPartialCharge SetPartialCharge Partial Charges
Atomic Hybridization unsigned int GetHyb SetHyb  
Integer Atom Type int GetIntType SetIntType  
Atom Name string GetName SetName  
Atom Type Name string GetType SetType  
Atom Radius double GetRadius SetRadius  
Reaction Role unsigned int GetRxnRole SetRxnRole Reactions
Reaction Map Index unsigned int GetMapIdx SetMapIdx Reactions
Ring Membership bool IsInRing SetIsInRing Ring Perception
Aromaticity bool IsAromatic SetAromatic Aromaticity
Atom Chirality bool IsChiral SetChiral Stereochemistry
Atom Stereo unsigned int GetStereo SetStereo Stereochemistry

Read Only Atom Properties

Property Name Type Get Method See Also
Atom Degree unsigned int GetDegree  
Explicit Atom Degree unsigned int GetExplicitDegree  
Explicit Hydrogen Count unsigned int GetExplicitHCount
Explicit Valence unsigned int GetExplicitValence Valence Models
Atom Heavy Degree unsigned int GetHvyDegree  
Atom Heavy Valence unsigned int GetHvyValence Valence Models
Atom Parent OEMolBase GetParent  
Total Hydrogen Count unsigned int GetTotalHCount
Atom Valence unsigned int GetValence Valence Models
Atom Index unsigned int GetIdx Atom, Bond, and Conformer Indices
Atom Has Stereo bool HasStereoSpecified Stereochemistry Perception
Atom Connection bool IsConnected  

Attach Generic Data to Atoms

Generic data (see Generic Data) can be attached to any object that derives from the OEBase class. The following program shows an example where hydrogen bonding donor property is attached as a bool value to the corresponding OEAtomBase object.

Listing 2: Example of attaching generic data to atoms

from openeye import oechem

IsDonorAtom = oechem.OEMatchAtom("[!H0;#7,#8]")

mol = oechem.OEGraphMol()
oechem.OESmilesToMol(mol, "c1c(Cl)cncc1C(=O)O")

for atom in mol.GetAtoms():
    atom.SetData("isdonor", IsDonorAtom(atom))

class IsDonorAtomPred(oechem.OEUnaryAtomPred):
    def __call__(self, atom):
        return atom.GetData("isdonor")

print("Donor atoms:", end=" ")
for atom in mol.GetAtoms(IsDonorAtomPred()):
    print(atom.GetIdx(), oechem.OEGetAtomicSymbol(atom.GetAtomicNum()), end=" ")

The OEAtomBase API provides the following methods, publicly inherited from OEBase, that allow the manipulation of generic data.

Methods to manipulate generic data
Method Description
SetData sets a generic data associating it with the given tag
AddData adds a generic data associating it with the given tag
HasData determines whether a molecule has any generic data with a given tag
GetData returns the generic data associated with the given tag
DeleteData deletes all generic data with the given tag
Clear clears all stored generic data


Generic data attached to a molecule or any of its atoms or bonds is automatically saved when the molecule is written into an .oeb file.