zaixizhang / MGSSL

Official implementation of NeurIPS'21 paper"Motif-based Graph Self-Supervised Learning for Molecular Property Prediction"
Apache License 2.0
107 stars 15 forks source link

[error] rdkit.Chem.rdchem.KekulizeException: Can't kekulize mol. #2

Closed seyongk closed 2 years ago

seyongk commented 2 years ago

Hello! I'm trying to run mol_tree.py, but I'm getting KekulizeException: error. Is it a problem about rdkit version? Below are my rdkit version and console output.

rdkit=2021.09.2=py37h13c2175_0

runfile('/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util/mol_tree.py', wdir='/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util') Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:53) Type 'copyright', 'credits' or 'license' for more information IPython 7.30.1 -- An enhanced Interactive Python. Type '?' for help. PyDev console: using IPython 7.30.1 Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:53) [GCC 9.4.0] on linux start CC(C)(C)c1ccc2occ(CC(=O)Nc3ccccc3F)c2c1 C[C@@H]1CC(Nc2cncc(-c3nncn3C)c2)CC@@HC1 N#Cc1ccc(-c2ccc(OC@@Hc3ccccc3)cc2)cc1 CCOC(=O)[C@@H]1CCCN(C(=O)c2nc(-c3ccc(C)cc3)n3c2CCCCC3)C1 N#CC1=C(SCC(=O)Nc2cccc(Cl)c2)N=C([O-])C@HC12CCCCC2 CCNH+C@(CC)C@Hc1cscc1Br COc1ccc(C(=O)N(C)C@@HC/C(N)=N/O)cc1O O=C(Nc1nc[nH]n1)c1cccnc1Nc1cccc(F)c1 Cc1c(/C=N/c2cc(Br)ccn2)c(O)n2c(nc3ccccc32)c1C#N Traceback (most recent call last): File "/home/bionuser/.conda/envs/bionlab/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3457, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in runfile('/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util/mol_tree.py', wdir='/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util') File "/home/bionuser/.pycharm_helpers/pydev/_pydev_bundle/pydev_umd.py", line 198, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "/home/bionuser/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util/mol_tree.py", line 149, in mol = MolTree(line) File "/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util/mol_tree.py", line 105, in init cmol = get_clique_mol(self.mol, c) File "/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util/chemutils.py", line 80, in get_clique_mol smiles = Chem.MolFragmentToSmiles(mol, atoms, kekuleSmiles=True) rdkit.Chem.rdchem.KekulizeException: Can't kekulize mol. Unkekulized atoms: 1 2 12 15 23

Thank you!

seyongk commented 2 years ago

No error occurs in rdkit 2020.09.1 ​​version. I will close the issue.

Thank you!

yuzhou2333 commented 1 year ago

excuse me,i can't find rdkit 2020.09.1 on the pypl,can u give this to me ,please answer me as soon as possible!TY~

seyongk commented 1 year ago

excuse me,i can't find rdkit 2020.09.1 on the pypl,can u give this to me ,please answer me as soon as possible!TY~

Hi. It seems that in 2021, rdkit version 2020.09.1 was available on PyPI, but now, in 2023, it seems to be no longer there. However, it appears to be available in the link below. (But I can't remember exactly which version I had installed.) https://anaconda.org/rdkit/rdkit/files