chemaxon.structurechecker
This package contains functions for structure checking of molecules, and fixers.
GitHub examples: https://github.com/ChemAxon/python-examples/blob/main/jupyter/05_structure_checker.ipynb
Chemical structure checker. It has method for both detecting various structural issues, or even fix them with
the fix method.
More info about structure checkers: https://docs.chemaxon.com/display/docs/structure-checker_index.html
Example:
structurechecker = StructureChecker("aromaticityerror:type=basic")
structurechecker = StructureChecker(["wedgeerror", "valenceerror"])
with open("config.xml") as f:
structurechecker = StructureChecker(f)
Configuration parameter in any of the following formats:
- xml string
- action string
- list of action strings
- file object of the configuration file.
Molecule structure checking.
Parameters
- mol: The molecule to be checked.
- return_colored_mol: Whether to return a colored molecule showing the errors. Default is
True.
Raises
- RuntimeError: If the molecule contains more than 500 atoms / bonds.
Returns
StructureCheckerBatchResult- Structure checking batch result.
Fixes the given structure based on the config provided during StructureChecker construction.
Parameters
- mol:
chemaxon.Moleculeto be fixed.
Returns
StructureFixerResultobject containing the fixed molecule and a flag showing if the fix was successful. If fix was unsuccessful it returns the original mol.
Contains a list of StructureChecker.check method results and an aggregated colored molecule showing all
errors as union.
colored molecule showing all errors as union, None if return_colored_mol is False or
no errors found
The result of the StructureChecker.check method. Contains information of the discovered issues.
colored molecule showing the errors, None if return_colored_mol is False
The result of the StructureChecker.fix method.
It contains the fixed molecule and a flag indicating whether the fix was successful.