Atom Type Translation Table.
Molecular file formats frequently store information about atoms in an atom type field. Some formats store only the element for each atom, while others include hybridization and local environments, such as the Sybyl mol2 atom type field. The OBTypeTable class acts as a translation table to convert atom types between a number of different molecular file formats. The constructor for OBTypeTable automatically reads the text file types.txt. An instance of OBTypeTable (ttab) is declared external in data.cpp and is referenced as extern OBTypeTable ttab in mol.h. The following code demonstrates how to use the OBTypeTable class to translate the internal representation of atom types in an OBMol Internal to Sybyl Mol2 atom types.
OBAtom *atom;
vector<OBAtom*>::iterator i;
string src,dst;
for (atom = mol.
BeginAtom(i);atom;atom = mol.EndAtom(i))
{
src = atom->GetType();
cout << "atom number " << atom->GetIdx() << "has mol2 type " << dst << endl;
}
Current atom types include (defined in the top line of the data file types.txt):
- INT (Open Babel internal codes)
- ATN (atomic numbers)
- HYB (hybridization)
- MMD (MacroModel)
- MM2 (MM2 force field)
- XYZ (element symbols from XYZ file format)
- ALC (Alchemy)
- HAD (H added)
- MCML (MacMolecule)
- C3D (Chem3D)
- SYB (Sybyl mol2)
- MOL (Sybyl mol)
- MAP (Gasteiger partial charge types)
- DRE (Dreiding)
- XED (XED format)
- DOK (Dock)
- M3D (Molecular Arts M3D)
- SBN (Sybyl descriptor types for MPD files)
- PCM (PC Model)