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

rdMolEnumerator.Enumerate() fragile w.r.t. atom ordering #3844

Closed
greglandrum opened this issue Feb 23, 2021 · 0 comments
Closed

rdMolEnumerator.Enumerate() fragile w.r.t. atom ordering #3844

greglandrum opened this issue Feb 23, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@greglandrum
Copy link
Member

If a molecule contains variable attachment points with connected-atom indices lower than the atom indices found in a linknode, the enumeration fails.

Here's an example molecule where this happens:
image

And the actual reproducible:

>>> m = Chem.MolFromMolBlock('''
...   Mrv2014 02182116082D          
... 
...   0  0  0     0  0            999 V3000
... M  V30 BEGIN CTAB
... M  V30 COUNTS 15 14 0 0 0
... M  V30 BEGIN ATOM
... M  V30 1 C -2.1474 10.0453 0 0
... M  V30 2 C -3.481 9.2753 0 0
... M  V30 3 C -3.481 7.7352 0 0
... M  V30 4 C -2.1474 6.9652 0 0
... M  V30 5 C -0.8137 7.7352 0 0
... M  V30 6 C -0.8137 9.2753 0 0
... M  V30 7 N 0.6334 9.802 0 0
... M  V30 8 C 0.7204 7.3118 0 0
... M  V30 9 C 1.5815 8.5885 0 0
... M  V30 10 * -3.0365 9.0186 0 0
... M  V30 11 O -3.0365 11.3286 0 0
... M  V30 12 C 1.0579 11.2824 0 0
... M  V30 13 O -0.0119 12.3901 0 0
... M  V30 14 * 1.151 7.9501 0 0
... M  V30 15 C 1.151 10.2601 0 0
... M  V30 END ATOM
... M  V30 BEGIN BOND
... M  V30 1 1 1 2
... M  V30 2 2 2 3
... M  V30 3 1 3 4
... M  V30 4 2 4 5
... M  V30 5 1 5 6
... M  V30 6 2 1 6
... M  V30 7 1 7 9
... M  V30 8 1 7 6
... M  V30 9 1 5 8
... M  V30 10 2 8 9
... M  V30 11 1 10 11 ENDPTS=(3 2 3 1) ATTACH=ANY
... M  V30 12 1 7 12
... M  V30 13 1 12 13
... M  V30 14 1 14 15 ENDPTS=(2 8 9) ATTACH=ANY
... M  V30 END BOND
... M  V30 LINKNODE 1 2 2 12 7 12 13
... M  V30 END CTAB
... M  END''')
>>> res = rdMolEnumerator.Enumerate(m)
Traceback (most recent call last):
  File "<ipython-input-5-c7650297002a>", line 1, in <module>
    res = rdMolEnumerator.Enumerate(m)
ValueError: bond not found between atoms in LINKNODE '1 2 2 12 7 12 13'
@greglandrum greglandrum added this to the 2021_03_1 milestone Feb 23, 2021
@greglandrum greglandrum self-assigned this Feb 23, 2021
greglandrum added a commit to greglandrum/rdkit that referenced this issue Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant