chemaxon.structurechecker.structurechecker

class StructureCheckerResult:

StructureCheckerResult

StructureCheckerResult( result: chemaxon.structurechecker.structurechecker._CStructureCheckerResult, returnColoredHit: bool)
description: str

Description of the found error

checker_name: str

name of the checker reporting the error

colored molecule showing the errors, None if returnColoredHit is False

atom_indexes: list

list of atom indexes with errors

bond_indexes: list

list of bond indexes with errors

sgroup_indexes: list

list of sgroup indexes with errors

rgroup_ids: list

list of rgroup ids with errors

class StructureCheckerBatchResult:

StuctureCheckerBatchResult

StructureCheckerBatchResult( result: chemaxon.structurechecker.structurechecker._CStructureCheckerBatchResult, returnColoredHit: bool)
results: list

list of StructureCheckerResults

aggregated_colored_mol: chemaxon.molecule.Molecule

colored molecule showing all errors as union, None if returnedColoredHit is False or no errors found

def is_error_free(self) -> bool:

Returns whether there is no error detected in the molecule.

class StructureFixerResult:

StructureFixerResult

StructureFixerResult( fixer_result: chemaxon.structurechecker.structurechecker._CStructureFixerResult)

fixed molecule or the original if fix was not successful

is_fix_successful: bool

whether the fixing was successful

class StructureChecker:

Creates a structurechecker object.

More info about structure checkers: https://docs.chemaxon.com/display/docs/structure-checker_index

Example:

 structurechecker = StructureChecker("aromaticityerror:type=basic")

 structurechecker = StructureChecker(["wedgeerror", "valenceerror"])

 with open("config.xml") as f:
     structurechecker = StructureChecker(f)
StructureChecker(config)
config: str

Configuration parameter in any of the following formats:

  • xml string
  • action string
  • list of action strings
  • file object of the configuration file.
def check( self, mol: chemaxon.molecule.Molecule, returnColoredHit: bool = True) -> StructureCheckerBatchResult:

Molecule structure checking.

Parameters
  • mol: The molecule to be checked.
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: Molecule to be fixed.
Returns

StructureFixerResult object containing the fixed molecule and a flag showing if the fix was successful. If fix was unsuccessful it returns the original mol.