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

SMARTS output for [x] is wrong #314

Closed
greglandrum opened this issue Aug 19, 2014 · 0 comments
Closed

SMARTS output for [x] is wrong #314

greglandrum opened this issue Aug 19, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@greglandrum
Copy link
Member

Problem 1 is that [x] by itself should match an atom with at least one ring bond, instead it's matching something with exactly one ring bond (which is equivalent to "never"):

In [19]: m = Chem.MolFromSmiles('C1CC1')

In [20]: m.HasSubstructMatch(Chem.MolFromSmarts('[x]'))
Out[20]: False

Problem 2 is that the output is kind of stupid:

In [3]: Chem.MolToSmarts(Chem.MolFromSmarts('[x]'))
Out[3]: '[$(*@*)&!$(*(@*)@*)]'

This is somewhat byzantine, and can never match, but it's at least correct:

In [4]: Chem.MolToSmarts(Chem.MolFromSmarts('[x1]'))
Out[4]: '[$(*@*)&!$(*(@*)@*)]'
@greglandrum greglandrum added this to the 2014_09_1 milestone Aug 19, 2014
@greglandrum greglandrum self-assigned this Aug 19, 2014
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