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

rdkit.Ched.rdFMCS.FindMCS generates invalid smarts #2801

Closed
luancarvalhomartins opened this issue Nov 18, 2019 · 1 comment · Fixed by #2802
Closed

rdkit.Ched.rdFMCS.FindMCS generates invalid smarts #2801

luancarvalhomartins opened this issue Nov 18, 2019 · 1 comment · Fixed by #2802
Assignees
Labels
Milestone

Comments

@luancarvalhomartins
Copy link

luancarvalhomartins commented Nov 18, 2019

Configuration:

  • RDKit Version: 2019.09.1
  • Operating system: Linux laptop 5.0.0-36-generic Support turning off sanitization for GetMolFrags() from python. #39-Ubuntu SMP Tue Nov 12 09:46:06 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • Python version (if relevant): 3.6
  • Are you using conda? Yes
  • If you are using conda, which channel did you install the rdkit from? conda install rdkit -c rdkit

Description:

rdkit.Ched.rdFMCS.FindMCS generates invalid SMARTS if ringMatchesRingOnly = True and the MCS contains a query atom bonded through an "any bond" type bond. This is irrespective of the molecule bearing a ring.

import rdkit.Chem, rdkit.Chem.rdFMCS

mol = rdkit.Chem.MolFromSmarts('*~CCC')

# Works
args = {'ringMatchesRingOnly': False}
rdkit.Chem.MolFromSmarts(rdkit.Chem.rdFMCS.FindMCS([mol, mol], **args).smartsString)

# SMARTS Parse Error: Failed parsing SMARTS '[#0&!R]&!@[#6&!R]-&!@[#6&!R]-&!@[#6&!R]' for input: '[#0&!R]&!@[#6&!R]-&!@[#6&!R]-&!@[#6&!R]'
args = {'verbose': False, 'ringMatchesRingOnly': True}
rdkit.Chem.MolFromSmarts(rdkit.Chem.rdFMCS.FindMCS([mol, mol], **args).smartsString)

@luancarvalhomartins luancarvalhomartins changed the title Segmentation fault on rdkit.Ched.rdFMCS.FindMCS rdkit.Ched.rdFMCS.FindMCS generates invalid smarts Nov 18, 2019
@ptosco ptosco self-assigned this Nov 18, 2019
@ptosco
Copy link
Contributor

ptosco commented Nov 18, 2019

@luancarvalhomartins thanks for reporting this bug. Tomorrow I'll commit the fix together with a new unit test.

@ptosco ptosco added the bug label Nov 18, 2019
ptosco added a commit to ptosco/rdkit that referenced this issue Nov 19, 2019
- corrects a couple of typos
@ptosco ptosco mentioned this issue Nov 19, 2019
@greglandrum greglandrum added this to the 2019_09_2 milestone Nov 29, 2019
greglandrum pushed a commit that referenced this issue Nov 29, 2019
- corrects a couple of typos
greglandrum pushed a commit that referenced this issue Dec 3, 2019
- corrects a couple of typos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants