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 |
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
| OBAromaticTyper | ( | ) |
| ~OBAromaticTyper | ( | ) |
| size_t GetSize | ( | ) | [inline, virtual] |
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)
| 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
| mol | the molecule |
| avoidInnerRingAtoms | inner closure ring atoms with more than 2 neighbours will be avoided |
| void ExcludeSmallRing | ( | OBMol & | mol ) |
Remove 3-member rings from consideration.
| void CheckAromaticity | ( | OBAtom * | root, |
| int | searchDepth | ||
| ) |
Check aromaticity starting from the root atom, up to a specified depth.
| bool TraverseCycle | ( | OBAtom * | root, |
| OBAtom * | atom, | ||
| OBBond * | prev, | ||
| std::pair< int, int > & | er, | ||
| int | depth | ||
| ) |
Traverse a potentially aromatic cycle starting at root.
| 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.
| void Init | ( | ) | [inherited] |
Read in the data file, falling back as needed.
| 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()
bool _init [protected, inherited] |
Whether the data been read already.
const char* _dataptr [protected, inherited] |
Default data table if file is unreadable.
std::string _filename [protected, inherited] |
File to search for.
std::string _dir [protected, inherited] |
Data directory for file if _envvar fails.
std::string _subdir [protected, inherited] |
Subdirectory (if using environment variable)
std::string _envvar [protected, inherited] |
Environment variable to check first.