Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmiles.utils.to_canonical_label failure #30

Open
jchodera opened this issue Sep 7, 2019 · 2 comments
Open

cmiles.utils.to_canonical_label failure #30

jchodera opened this issue Sep 7, 2019 · 2 comments

Comments

@jchodera
Copy link
Member

jchodera commented Sep 7, 2019

The following code raises an exception:

>>> import cmiles
>>> cmiles.utils.to_canonical_label("[H:13][c:1]1[c:3]([n:8][c:5]([n:10][c:6]1[N:12]([H:19])[c:7]2[c:2]([c:4]([n:9][n:11]2[H:18])[H:16])[H:14])[H:17])[H:15]", (9, 5, 11, 5))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/choderaj/miniconda/lib/python3.7/site-packages/cmiles/utils.py", line 193, in to_canonical_label
    return toolkit.generate_index(mol, labeled_atoms)
  File "/Users/choderaj/miniconda/lib/python3.7/site-packages/cmiles/_cmiles_oe.py", line 203, in generate_index
    a.SetMapIdx(i + 1)
AttributeError: 'NoneType' object has no attribute 'SetMapIdx'
@ChayaSt
Copy link
Collaborator

ChayaSt commented Nov 26, 2019

@jchodera, the problem here seems to be that the labels you are providing for the atoms have 5 twice. So you are trying to add 2 labels to the same atom.

@ChayaSt
Copy link
Collaborator

ChayaSt commented Nov 26, 2019

@jthorton, openeye will throw an error if the same atom is being labeled twice but rdkit will silently return an index ignoring the second occurrence of the same index. RDKit should raise an error so this is something _cmiles_rdkit.py should check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants