Skip to content

Commit

Permalink
catch kekulize error in MolToV3KMolBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
MTLehner committed Apr 3, 2024
1 parent bf702d0 commit d62616e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lwreg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
}

from rdkit.Chem.RegistrationHash import HashLayer
from rdkit.Chem import KekulizeException


class RegistrationFailureReasons(enum.Enum):
Expand Down Expand Up @@ -483,7 +484,10 @@ def _register_mol(tpl,
Chem.AssignStereochemistryFrom3D(sMol, confId)
if sMol is None:
return None, None
molb = Chem.MolToV3KMolBlock(sMol, confId=confId)
try:
molb = Chem.MolToV3KMolBlock(sMol, confId=confId)
except KekulizeException:
return None, None

mhash, layers = hash_mol(sMol, escape=escape, config=config)

Expand Down

0 comments on commit d62616e

Please sign in to comment.