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 |
|||
Formal Charge |
int |
|||
Implicit Hyd. Count |
unsigned int |
|||
Isotopic Mass |
unsigned int |
|||
Partial Charge |
double |
|||
Atomic Hybridization |
unsigned int |
|||
Integer Atom Type |
int |
|||
Atom Name |
string |
|||
Atom Type Name |
string |
|||
Atom Radius |
double |
|||
Reaction Role |
unsigned int |
|||
Reaction Map Index |
unsigned int |
|||
Ring Membership |
bool |
|||
Aromaticity |
bool |
|||
Atom Chirality |
bool |
|||
Atom Stereo |
unsigned int |
Read Only Atom Properties¶
Property Name |
Type |
Get Method |
See Also |
---|---|---|---|
Atom Degree |
unsigned int |
||
Explicit Atom Degree |
unsigned int |
||
Explicit Hydrogen Count |
unsigned int |
||
Explicit Valence |
unsigned int |
||
Atom Heavy Degree |
unsigned int |
||
Atom Heavy Valence |
unsigned int |
||
Atom Parent |
|||
Total Hydrogen Count |
unsigned int |
||
Atom Valence |
unsigned int |
||
Atom Index |
unsigned int |
||
Atom Has Stereo |
bool |
||
Atom Connection |
bool |
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
package openeye.docexamples.oechem;
import openeye.oechem.*;
public class GenericDataToAtom {
private static class IsDonorAtomPred extends OEUnaryAtomPred {
public boolean constCall(OEAtomBase atom) {
return atom.GetBoolData("isdonor");
}
public OEUnaryAtomBoolFunc CreateCopy() {
OEUnaryAtomBoolFunc copy = new IsDonorAtomPred();
copy.swigReleaseOwnership();
return copy;
}
}
public static void main(String argv[]) {
OEGraphMol mol = new OEGraphMol();
oechem.OESmilesToMol(mol, "c1c(Cl)cncc1C(=O)O");
OEMatchAtom IsDonorAtom = new OEMatchAtom("[!H0;#7,#8]");
for (OEAtomBase atom : mol.GetAtoms()) {
atom.SetBoolData("isdonor", IsDonorAtom.constCall(atom));
}
System.out.print("Donor atoms: ");
for (OEAtomBase atom : mol.GetAtoms(new IsDonorAtomPred())) {
System.out.print(atom.GetIdx() + " " + oechem.OEGetAtomicSymbol(atom.GetAtomicNum()));
}
System.out.println("");
}
}
The OEAtomBase API provides the following methods, publicly inherited from OEBase, that allow the manipulation of generic data.
Method |
Description |
---|---|
sets a generic data associating it with the given tag |
|
adds a generic data associating it with the given tag |
|
determines whether a molecule has any generic data with a given tag |
|
returns the generic data associated with the given tag |
|
deletes all generic data with the given tag |
|
clears all stored generic data |
Note
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.
See also
Attaching other objects section
SD Tagged Data Manipulation section
PDB Tagged Data Manipulation section