From e49d2bdeff5456dba60fe7bb96eab72d388d65a8 Mon Sep 17 00:00:00 2001 From: Bryan Saldivar Date: Mon, 10 Jul 2023 09:30:17 +0200 Subject: [PATCH] Update chemutils.py: Added clearAromaticFlags=True to get_mol Fixing reported error: https://github.com/wengong-jin/hgraph2graph/issues/24 rdkit.Chem.rdchem.KekulizeException: Can't kekulize mol. Unkekulized atoms: 4 5 6 7 18 --- hgraph/chemutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hgraph/chemutils.py b/hgraph/chemutils.py index cd2689e..258fa7b 100644 --- a/hgraph/chemutils.py +++ b/hgraph/chemutils.py @@ -14,7 +14,7 @@ def set_atommap(mol, num=0): def get_mol(smiles): mol = Chem.MolFromSmiles(smiles) - if mol is not None: Chem.Kekulize(mol) + if mol is not None: Chem.Kekulize(mol,clearAromaticFlags=True) return mol def get_smiles(mol):