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

Need implicit H cleanup after rdMolEnumerator.Enumerate() #4381

Closed
greglandrum opened this issue Aug 3, 2021 · 0 comments
Closed

Need implicit H cleanup after rdMolEnumerator.Enumerate() #4381

greglandrum opened this issue Aug 3, 2021 · 0 comments
Labels
Milestone

Comments

@greglandrum
Copy link
Member

Describe the bug
When enumerating this query:

qry = Chem.MolFromMolBlock('''
  Mrv2108 08012107372D          

  0  0  0     0  0            999 V3000
M  V30 BEGIN CTAB
M  V30 COUNTS 11 11 0 0 0
M  V30 BEGIN ATOM
M  V30 1 C -2.4167 7.8734 0 0
M  V30 2 C -3.7503 7.1034 0 0
M  V30 3 C -3.7503 5.5633 0 0
M  V30 4 N -2.4167 4.7933 0 0
M  V30 5 C -1.083 5.5633 0 0
M  V30 6 C -1.083 7.1034 0 0
M  V30 7 N 0.3973 7.5279 0 0
M  V30 8 N 0.3104 5.0377 0 0
M  V30 9 C 1.2585 6.2511 0 0
M  V30 10 * 0.3539 6.2828 0 0
M  V30 11 C 1.5089 8.2833 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 6
M  V30 8 1 5 8
M  V30 9 1 8 9
M  V30 10 2 7 9
M  V30 11 1 10 11 ENDPTS=(2 8 7) ATTACH=ANY
M  V30 END BOND
M  V30 END CTAB
M  END
''')

which corresponds to this molecule:
image

The SMARTS generated indicate that the N atom which doesn't get the attachment point ends up an implicit H:

for m in rdMolEnumerator.Enumerate(qry):
    print(Chem.MolToSmarts(m))

produces:

[#6]1:[#6]:[#6]:[#7]:[#6]2:[#6]:1:[#7]:[#6]:[#7H]:2-[#6]
[#6]1:[#6]:[#6]:[#7]:[#6]2:[#6]:1:[#7](:[#6]:[#7H]:2)-[#6]

Expected behavior
The SMARTS for those should be:

[#6]1:[#6]:[#6]:[#7]:[#6]2:[#6]:1:[#7]:[#6]:[#7]:2-[#6]
[#6]1:[#6]:[#6]:[#7]:[#6]2:[#6]:1:[#7](:[#6]:[#7]:2)-[#6]

Configuration (please complete the following information):

  • RDKit version: master and releases
  • OS: all
@greglandrum greglandrum added the bug label Aug 3, 2021
greglandrum added a commit to greglandrum/rdkit that referenced this issue Aug 4, 2021
@greglandrum greglandrum added this to the 2021_03_5 milestone Aug 4, 2021
greglandrum added a commit that referenced this issue Aug 24, 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