![]() |
Chemical Data Processing Library Python API - Version 1.4.0
|
Enumerates the tautomers of a molecular graph by iteratively applying a configurable set of Chem.TautomerizationRule instances and reporting each accepted tautomer to a user-supplied callback. More...
Inheritance diagram for CDPL.Chem.TautomerGenerator:Classes | |
| class | Mode |
| Constants specifying the output tautomer filtering strategy. More... | |
Public Member Functions | |
| None | __init__ () |
Constructs the TautomerGenerator instance. | |
| None | __init__ (TautomerGenerator gen) |
Constructs a copy of the TautomerGenerator instance gen. More... | |
| int | getObjectID () |
| Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
| None | addTautomerizationRule (TautomerizationRule rule) |
| Registers a new tautomerization rule. More... | |
| None | removeTautomerizationRule (int idx) |
| Removes the registered tautomerization rule at index idx. More... | |
| TautomerizationRule | getTautomerizationRule (int idx) |
| Returns the registered tautomerization rule at index idx. More... | |
| int | getNumTautomerizationRules () |
| Returns the number of registered tautomerization rules. More... | |
| None | setCallbackFunction (BoolMolecularGraphFunctor func) |
| Sets the callback invoked for every accepted output tautomer. More... | |
| BoolMolecularGraphFunctor | getCallbackFunction () |
| Returns the currently configured callback. More... | |
| None | setMode (Mode mode) |
| Sets the tautomer duplicate filtering mode. More... | |
| Mode | getMode () |
| Returns the currently configured tautomer duplicate filtering mode. More... | |
| None | regardStereochemistry (bool regard) |
| Specifies whether atom/bond stereochemistry shall be regarded by the tautomer duplicate detection algorithm. More... | |
| bool | stereochemistryRegarded () |
| Tells whether atom/bond stereochemistry is regarded by the tautomer duplicate detection algorithm. More... | |
| None | regardIsotopes (bool regard) |
| Specifies whether atom isotope information shall be regarded by the tautomer duplicate detection algorithm. More... | |
| bool | isotopesRegarded () |
| Tells whether atom isotope information is regarded by the tautomer duplicate detection algorithm. More... | |
| bool | coordinates2DCleared () |
| Tells whether 2D atom coordinates are cleared from the generated tautomers. More... | |
| bool | coordinates3DCleared () |
| Tells whether 3D atom coordinates are cleared from the generated tautomers. More... | |
| None | removeResonanceDuplicates (bool remove) |
| Specifies whether tautomers that differ only by resonance (no atom-connectivity change) shall be filtered out. More... | |
| bool | resonanceDuplicatesRemoved () |
| Tells whether resonance-only duplicates are filtered out. More... | |
| None | setCustomSetupFunction (VoidMolecularGraphFunctor func) |
| Sets the optional setup function invoked on the generated tautomers. More... | |
| None | generate (MolecularGraph molgraph) |
| Enumerates the tautomers of molgraph and reports each accepted one to the registered callback. More... | |
| TautomerGenerator | assign (TautomerGenerator gen) |
| Replaces the state of this generator by a copy of the state of gen. More... | |
Properties | |
| objectID = property(getObjectID) | |
| clearCoordinates2D = property(coordinates2DCleared, clearCoordinates2D) | |
| clearCoordinates3D = property(coordinates3DCleared, clearCoordinates3D) | |
| callbackFunction = property(getCallbackFunction, setCallbackFunction) | |
| mode = property(getMode, setMode) | |
| regStereo = property(stereochemistryRegarded, regardStereochemistry) | |
| regIsotopes = property(isotopesRegarded, regardIsotopes) | |
| remResonanceDuplicates = property(resonanceDuplicatesRemoved, removeResonanceDuplicates) | |
| numTautomerizationRules = property(getNumTautomerizationRules) | |
Enumerates the tautomers of a molecular graph by iteratively applying a configurable set of Chem.TautomerizationRule instances and reporting each accepted tautomer to a user-supplied callback.
After registering tautomerization rules (via addTautomerizationRule()) and a callback (via setCallbackFunction()), each call to generate() seeds the enumeration with the input molecular graph, applies every registered rule to every intermediate tautomer to derive the next generation, and reports each newly-generated tautomer to the callback. The Mode setting controls how various types of duplicates shall be handled.
| None CDPL.Chem.TautomerGenerator.__init__ | ( | TautomerGenerator | gen | ) |
Constructs a copy of the TautomerGenerator instance gen.
| gen | The TautomerGenerator to copy. |
| int CDPL.Chem.TautomerGenerator.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python TautomerGenerator instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two TautomerGenerator instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().
| None CDPL.Chem.TautomerGenerator.addTautomerizationRule | ( | TautomerizationRule | rule | ) |
Registers a new tautomerization rule.
| rule | The tautomerization rule to register. |
| None CDPL.Chem.TautomerGenerator.removeTautomerizationRule | ( | int | idx | ) |
Removes the registered tautomerization rule at index idx.
| idx | The zero-based rule index. |
| Base.IndexError | if the number of rules is zero or idx is not in the range [0, getNumTautomerizationRules() - 1]. |
| TautomerizationRule CDPL.Chem.TautomerGenerator.getTautomerizationRule | ( | int | idx | ) |
Returns the registered tautomerization rule at index idx.
| idx | The zero-based rule index. |
| Base.IndexError | if the number of rules is zero or idx is not in the range [0, getNumTautomerizationRules() - 1]. |
| int CDPL.Chem.TautomerGenerator.getNumTautomerizationRules | ( | ) |
Returns the number of registered tautomerization rules.
| None CDPL.Chem.TautomerGenerator.setCallbackFunction | ( | BoolMolecularGraphFunctor | func | ) |
Sets the callback invoked for every accepted output tautomer.
The callback receives the tautomer molecular graph as its argument and returns a boolean: returning False aborts the enumeration.
| func | The new callback function. |
| BoolMolecularGraphFunctor CDPL.Chem.TautomerGenerator.getCallbackFunction | ( | ) |
Returns the currently configured callback.
| None CDPL.Chem.TautomerGenerator.setMode | ( | Mode | mode | ) |
Sets the tautomer duplicate filtering mode.
| mode | The new duplicate filtering mode. |
| Mode CDPL.Chem.TautomerGenerator.getMode | ( | ) |
Returns the currently configured tautomer duplicate filtering mode.
| None CDPL.Chem.TautomerGenerator.regardStereochemistry | ( | bool | regard | ) |
Specifies whether atom/bond stereochemistry shall be regarded by the tautomer duplicate detection algorithm.
| regard | If True, atom/bond stereo configurations are taken into account. |
| bool CDPL.Chem.TautomerGenerator.stereochemistryRegarded | ( | ) |
Tells whether atom/bond stereochemistry is regarded by the tautomer duplicate detection algorithm.
True if stereochemistry is regarded, and False otherwise. | None CDPL.Chem.TautomerGenerator.regardIsotopes | ( | bool | regard | ) |
Specifies whether atom isotope information shall be regarded by the tautomer duplicate detection algorithm.
| regard | If True, atom isotope information is taken into account. |
| bool CDPL.Chem.TautomerGenerator.isotopesRegarded | ( | ) |
Tells whether atom isotope information is regarded by the tautomer duplicate detection algorithm.
True if atom isotope information is regarded, and False otherwise. | bool CDPL.Chem.TautomerGenerator.coordinates2DCleared | ( | ) |
Tells whether 2D atom coordinates are cleared from the generated tautomers.
True if 2D coordinates are cleared, and False otherwise.| bool CDPL.Chem.TautomerGenerator.coordinates3DCleared | ( | ) |
Tells whether 3D atom coordinates are cleared from the generated tautomers.
True if 3D coordinates are cleared, and False otherwise.| None CDPL.Chem.TautomerGenerator.removeResonanceDuplicates | ( | bool | remove | ) |
Specifies whether tautomers that differ only by resonance (no atom-connectivity change) shall be filtered out.
| remove | If True, resonance-only duplicates are not reported. |
| bool CDPL.Chem.TautomerGenerator.resonanceDuplicatesRemoved | ( | ) |
Tells whether resonance-only duplicates are filtered out.
True if resonance duplicates are removed, and False otherwise.| None CDPL.Chem.TautomerGenerator.setCustomSetupFunction | ( | VoidMolecularGraphFunctor | func | ) |
Sets the optional setup function invoked on the generated tautomers.
| func | The new custom setup function. |
| None CDPL.Chem.TautomerGenerator.generate | ( | MolecularGraph | molgraph | ) |
Enumerates the tautomers of molgraph and reports each accepted one to the registered callback.
| molgraph | The molecular graph whose tautomers shall be generated. |
| TautomerGenerator CDPL.Chem.TautomerGenerator.assign | ( | TautomerGenerator | gen | ) |
Replaces the state of this generator by a copy of the state of gen.
| gen | The source TautomerGenerator. |