wengong-jin / icml18-jtnn

Junction Tree Variational Autoencoder for Molecular Graph Generation (ICML 2018)
MIT License
509 stars 190 forks source link

Kekulization Error #65

Open Yuvaraj7UV opened 1 year ago

Yuvaraj7UV commented 1 year ago

smiles = Chem.MolFragmentToSmiles(mol, atoms, kekuleSmiles=True) rdkit.Chem.rdchem.KekulizeException: Can't kekulize mol. Unkekulized atoms: 6 8 12

How did you deal with this kekulization error?

huangtinglin commented 1 year ago

I also encounter the same problem. Have you fixed it?

manurubo commented 1 year ago

I'm having the same problem.

I have found that if you modify the next in chemutils.py it works:

  1. set kekuleSmiles of .py to False (inside get_clique_mol and get_smiles)
  2. add sanitize=False in get_mol
  3. Comment Chem.Kekulize(mol) in get_mol.

But I'm not sure if the whole model is gonna be afected.

cosmina98 commented 1 year ago

I ve just added: 'for atom in atoms: mol.GetAtomWithIdx(atom).SetNumExplicitHs(4)' at the beginning of get_clique_mol() And did not modify anything else. "https://github.com/rdkit/rdkit/issues/3334" I am too unsure about how this affects the quality of the generated data

jianglikun commented 1 year ago

this is because the version of rdkit: pip install rdkit-pypi==2020.9.5.2