-
Notifications
You must be signed in to change notification settings - Fork 845
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
SMILES and SMARTS parse bonds in a different order #5683
Comments
I have now, but it doesn't seem the same issue. In what I wrote above, it can be seen that it is during the parsing of the SMARTS string that the bonds are not created in the same order as the positions they have in the string (the wiggly bond is moved from position 1 to 9), while in your issue, parsing the SMARTS still yields a mol with the atoms and bonds in the right orderings and with the correct chirality:
|
Another example, this time, with a CXSMILES string created by RDKit itself:
|
Turns out this is not the same issue as described above. We posted a fix for this in #5722 |
more testing required
This is a relevant issue when parsing strings with CX extensions, since these may include specifications that depend on bond indexes.
I noticed the issue because of a "incorrect" SMILES string:
The
smiles
string should also fail to parse as SMARTS, but it doesn't, we get a mol back!Looking into it, I stripped the CX extension from the string, and tried to parse it again, both as SMILES and SMARTS, and noticed the order of the bonds in the mol is different. Also, notice that bond 1 in the SMARTS is a double bond, so it doesn't make sense that it is wiggly (probably the parsed should check that too):
Note how the bond between atoms 1 and 2 has moved from index 1 in the SMILES to index 9 in the SMARTS. I think this doesn't have any impact on the Mol itself, but it breaks parsing the CX extensions (either for SMILES or for SMARTS, depending how the mol was generated), since the indexes of the bonds might no longer match the order in the literal string.
The text was updated successfully, but these errors were encountered: