[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

Isomeric SMILES exhibit cyclical canonicalization #8089

Open
NicklasOsterbacka opened this issue Dec 12, 2024 · 0 comments
Open

Isomeric SMILES exhibit cyclical canonicalization #8089

NicklasOsterbacka opened this issue Dec 12, 2024 · 0 comments
Labels

Comments

@NicklasOsterbacka
Copy link

Describe the bug
Certain isomeric SMILES strings exhibit cyclical canonicalization.

This is related to this and this issue, but I did not see this specific problem mentioned.

To Reproduce
The code snippet below checks if canonicalization 1+3 and 2+4 times gives the same SMILES representation.

from rdkit import Chem

def check_canon(smi):
    can1 = Chem.CanonSmiles(smi)
    can2 = Chem.CanonSmiles(can1)
    can3 = Chem.CanonSmiles(can2)
    can4 = Chem.CanonSmiles(can3)

    cyc1 = can1 == can3
    cyc2 = can2 == can4

    if cyc1 and cyc2:
        return True

smi = r"CC1=C\C/C=C(\C)CC[C@H]2C(C)(C)[C@@H](\\C=C/1)CC[C@]2(C)O"
print(check_canon(smi))

These SMILES also exhibit this behaviour:

COC1=N\C2=CC(=O)c3c(c(O)c(C)c4c3C(=O)C(C)(O/C=C/C(OC)C(C)C(OC(C)=O)C(C)C(O)C(C)C(O)C(C)/C=C\C=C/1C)O4)C2=O
CC1C2c3cc4/c5c6c7c8c9c%10c6c4c4c3C3=C6c%11c%12c%13c%14c%15c(c9c9c%16c8c(c8/c(c%17c%18c%19c(c(c%11c%11c%19c%19c%17c8c%16c(c%149)c%19c%13%11)C62)C1C%181C[N+](C)(C)C1)=C\C\C=5)C7)C%10C4C31C[N+](C)(C)CC%12%151
CC1=C\[C@H](C)C[C@@]2(C)CC[C@@H](O2)[C@@]23CC[C@@](C)(C[C@@H](O2)[C@H]2O[C@](C)(CC2=O)[C@@H](O)[C@@H]2CC[C@@]4(CCC[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=3
c1ccc2/c3[nH]/c(c2c1)=N\c1ccc(cc1)-c1nc2ccc(cc2o1)/N=c1/[nH]/c(c2ccccc12)=N/c1ccc2nc(oc2c1)-c1ccc(cc1)/N=3
CC1=C/[C@@H](C)C[C@]2(C)CC[C@H](O2)[C@]23CC[C@](C)(C[C@H](O2)[C@@H]2O[C@@](C)(CC2=O)[C@@H](O)[C@H]2CC[C@@]4(CCC[C@@H](O4)[C@H](C)C(=O)O[C@H]4C[C@H]([C@]5(O)OCC[C@H](C)[C@@H]5O)O[C@H]4\C=C/1)O2)O3
CC1=C/[C@@H](C)C[C@]2(C)CC[C@H](O2)[C@]23CC[C@](C(=O)O)(C[C@H](O2)[C@@H]2O[C@@](C)(CC2=O)[C@@H](O)[C@H]2CC[C@@]4(CCC[C@@H](O4)[C@H](C)C(=O)O[C@H]4C[C@H]([C@]5(O)OCC[C@H](C)[C@@H]5O)O[C@H]4\C=C/1)O2)O3
CC1=C/[C@@H](C)C[C@]2(C)CC[C@H](O2)[C@]23CC[C@](CO)(C[C@H](O2)[C@@H]2O[C@@](C)(CC2=O)[C@@H](O)[C@H]2CC[C@@]4(CCC[C@@H](O4)[C@H](C)C(=O)O[C@H]4C[C@H]([C@]5(O)OCC[C@H](C)[C@@H]5O)O[C@H]4\C=C/1)O2)O3
COC(=O)C1=C/c2cc3c(cc2-c2c(cc(OC)c(OC)c2OC)\C=C/1C(=O)OC)OCO3

Expected behavior
Stacking Chem.CanonSmiles calls should provide the same SMILES representation rather than exhibiting cyclical behaviour.

Configuration (please complete the following information):

  • RDKit version: 2024.09.2
  • OS: MacOS 14.7 (23H124)
  • Python version (if relevant): 3.12.7
  • Are you using conda? Yes
  • If you are using conda, which channel did you install the rdkit from? conda-forge
  • If you are not using conda: how did you install the RDKit? n/a
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