OBAromaticTyper Class Reference
Assigns aromatic typing to atoms and bonds. More...
#include <openbabel/typer.h>

Public Member Functions | |
OBAromaticTyper () | |
~OBAromaticTyper () | |
size_t | GetSize () |
void | ParseLine (const char *) |
void | AssignAromaticFlags (OBMol &) |
void | PropagatePotentialAromatic (OBAtom *) |
void | SelectRootAtoms (OBMol &, bool avoidInnerRingAtoms=true) |
void | ExcludeSmallRing (OBMol &) |
void | CheckAromaticity (OBAtom *root, int searchDepth) |
bool | TraverseCycle (OBAtom *root, OBAtom *atom, OBBond *prev, std::pair< int, int > &er, int depth) |
void | Init () |
void | SetReadDirectory (char *dir) |
void | SetEnvironmentVariable (char *var) |
Protected Attributes | |
bool | _init |
const char * | _dataptr |
std::string | _filename |
std::string | _dir |
std::string | _subdir |
std::string | _envvar |
Detailed Description
Assigns aromatic typing to atoms and bonds.
The OBAromaticTyper class is designed to read in a list of aromatic perception rules and apply them to molecules. The code that performs typing is not usually used directly -- it is usually done automatically when their corresponding values are requested of atoms or bonds.
atom->IsAromatic();
bond->IsAromatic();
bond->IsDouble(); // needs to check aromaticity and define Kekule structures
Constructor & Destructor Documentation
OBAromaticTyper | ( | ) |
~OBAromaticTyper | ( | ) |
Member Function Documentation
size_t GetSize | ( | ) | [inline, virtual] |
- Returns:
- the number of SMARTS patterns
Reimplemented from OBGlobalDataBase.
void ParseLine | ( | const char * | ) | [virtual] |
Specified by particular table classes (parses an individual data line).
Reimplemented from OBGlobalDataBase.
void AssignAromaticFlags | ( | OBMol & | mol | ) |
Assign aromaticity flag to atoms and bonds.
Referenced by OBAtomTyper::AssignHyb(), OBBond::IsAromatic(), OBAtom::IsAromatic(), OBBond::IsDouble(), OBBond::IsSingle(), and OBBond::IsTriple().
void PropagatePotentialAromatic | ( | OBAtom * | atom | ) |
"Anti-alias" potentially aromatic flags around a molecule (aromatic atoms need to have >= 2 neighboring ring atoms)
Referenced by OBAromaticTyper::AssignAromaticFlags().
void SelectRootAtoms | ( | OBMol & | mol, | |
bool | avoidInnerRingAtoms = true | |||
) |
Select the root atoms for traversing atoms in rings.
Picking only the begin atom of a closure bond can cause difficulties when the selected atom is an inner atom with three neighbour ring atoms. Why ? Because this atom can get trapped by the other atoms when determining aromaticity, because a simple visited flag is used in the OBAromaticTyper::TraverseCycle() method.
Ported from JOELib, copyright Joerg Wegner, 2003 under the GPL version 2 Improved by Fabian (fab5) in 2009 -- PR#2889708
- Parameters:
-
mol the molecule avoidInnerRingAtoms inner closure ring atoms with more than 2 neighbours will be avoided
Referenced by OBAromaticTyper::AssignAromaticFlags().
void ExcludeSmallRing | ( | OBMol & | mol | ) |
Remove 3-member rings from consideration.
Referenced by OBAromaticTyper::AssignAromaticFlags().
void CheckAromaticity | ( | OBAtom * | root, | |
int | searchDepth | |||
) |
Check aromaticity starting from the root atom, up to a specified depth.
Referenced by OBAromaticTyper::AssignAromaticFlags().
bool TraverseCycle | ( | OBAtom * | root, | |
OBAtom * | atom, | |||
OBBond * | prev, | |||
std::pair< int, int > & | er, | |||
int | depth | |||
) |
Traverse a potentially aromatic cycle starting at root
.
- Returns:
- True if the cycle is likely aromatic
- Parameters:
-
root The initial, "root" atom in traversing this ring atom The current atom to visit and check prev The bond traversed in moving to this atom
er The min and max number of pi electrons for this ring depth The maximum number of atoms to visit in a ring (e.g., 6)
This method traverses a potentially aromatic ring, adding up the possible pi electrons for each atom. At the end (e.g., when atom
== root
) the Huekel 4n+2 rule is checked to see if there is a possible electronic configuration which corresponds to aromaticity.
Referenced by OBAromaticTyper::CheckAromaticity().
void Init | ( | ) | [inherited] |
Read in the data file, falling back as needed.
Referenced by OBAromaticTyper::AssignAromaticFlags(), OBResidueData::AssignBonds(), OBBondTyper::AssignFunctionalGroupBonds(), OBAtomTyper::AssignHyb(), OBAtomTyper::AssignImplicitValence(), OBPhModel::AssignSeedPartialCharge(), OBRingTyper::AssignTypes(), OBAtomTyper::AssignTypes(), OBAtomTyper::CorrectAromaticNitrogens(), OBElementTable::CorrectedBondRad(), OBElementTable::CorrectedVdwRad(), OBPhModel::CorrectForPH(), OBElementTable::GetAllredRochowElectroNeg(), OBElementTable::GetAtomicNum(), OBElementTable::GetCovalentRad(), OBElementTable::GetElectronAffinity(), OBElementTable::GetElectroNeg(), OBIsotopeTable::GetExactMass(), OBTypeTable::GetFromType(), OBElementTable::GetIonization(), OBElementTable::GetMass(), OBElementTable::GetMaxBonds(), OBElementTable::GetName(), OBElementTable::GetNumberOfElements(), OBElementTable::GetRGB(), OBRotorRules::GetRotorIncrements(), OBElementTable::GetSymbol(), OBTypeTable::GetToType(), OBElementTable::GetVdwRad(), OBTypeTable::SetFromType(), OBResidueData::SetResName(), OBTypeTable::SetToType(), and OBTypeTable::Translate().
void SetReadDirectory | ( | char * | dir | ) | [inline, inherited] |
Set the directory before calling Init().
void SetEnvironmentVariable | ( | char * | var | ) | [inline, inherited] |
Set the environment variable to use before calling Init().
Member Data Documentation
bool _init [protected, inherited] |
Whether the data been read already.
Referenced by OBAromaticTyper::AssignAromaticFlags(), OBResidueData::AssignBonds(), OBBondTyper::AssignFunctionalGroupBonds(), OBAtomTyper::AssignHyb(), OBAtomTyper::AssignImplicitValence(), OBPhModel::AssignSeedPartialCharge(), OBRingTyper::AssignTypes(), OBAtomTyper::AssignTypes(), OBAtomTyper::CorrectAromaticNitrogens(), OBElementTable::CorrectedBondRad(), OBElementTable::CorrectedVdwRad(), OBPhModel::CorrectForPH(), OBElementTable::GetAllredRochowElectroNeg(), OBElementTable::GetAtomicNum(), OBElementTable::GetCovalentRad(), OBElementTable::GetElectronAffinity(), OBElementTable::GetElectroNeg(), OBIsotopeTable::GetExactMass(), OBTypeTable::GetFromType(), OBElementTable::GetIonization(), OBElementTable::GetMass(), OBElementTable::GetMaxBonds(), OBElementTable::GetName(), OBElementTable::GetNumberOfElements(), OBElementTable::GetRGB(), OBRotorRules::GetRotorIncrements(), OBElementTable::GetSymbol(), OBTypeTable::GetToType(), OBElementTable::GetVdwRad(), OBGlobalDataBase::Init(), OBAromaticTyper::OBAromaticTyper(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBElementTable::OBElementTable(), OBIsotopeTable::OBIsotopeTable(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), OBTypeTable::OBTypeTable(), OBTypeTable::SetFromType(), OBResidueData::SetResName(), OBTypeTable::SetToType(), and OBTypeTable::Translate().
const char* _dataptr [protected, inherited] |
Default data table if file is unreadable.
Referenced by OBGlobalDataBase::Init(), OBAromaticTyper::OBAromaticTyper(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBElementTable::OBElementTable(), OBIsotopeTable::OBIsotopeTable(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().
std::string _filename [protected, inherited] |
File to search for.
Referenced by OBGlobalDataBase::Init(), OBAromaticTyper::OBAromaticTyper(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBElementTable::OBElementTable(), OBIsotopeTable::OBIsotopeTable(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().
std::string _dir [protected, inherited] |
Data directory for file if _envvar fails.
Referenced by OBAromaticTyper::OBAromaticTyper(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBElementTable::OBElementTable(), OBIsotopeTable::OBIsotopeTable(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().
std::string _subdir [protected, inherited] |
Subdirectory (if using environment variable).
Referenced by OBAromaticTyper::OBAromaticTyper(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBElementTable::OBElementTable(), OBIsotopeTable::OBIsotopeTable(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().
std::string _envvar [protected, inherited] |
Environment variable to check first.
Referenced by OBGlobalDataBase::Init(), OBAromaticTyper::OBAromaticTyper(), OBAtomTyper::OBAtomTyper(), OBBondTyper::OBBondTyper(), OBElementTable::OBElementTable(), OBIsotopeTable::OBIsotopeTable(), OBPhModel::OBPhModel(), OBResidueData::OBResidueData(), OBRingTyper::OBRingTyper(), OBRotorRules::OBRotorRules(), and OBTypeTable::OBTypeTable().
The documentation for this class was generated from the following files: