8000 AssignStereochemistry is removing valid cis/trans bond stereo · Issue #2404 · rdkit/rdkit · GitHub
[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

AssignStereochemistry is removing valid cis/trans bond stereo #2404

Closed
yphillip opened this issue Apr 11, 2019 · 9 comments
Closed

AssignStereochemistry is removing valid cis/trans bond stereo #2404

yphillip opened this issue Apr 11, 2019 · 9 comments
Labels

Comments

@yphillip
Copy link

Description:
I am having similar issues to what was presented in #1614 where AssignStereochemistry seems to be removing valid CIS/TRANS stereochemistry from a double bond.

  • RDKit Version:2018.09.1.0
mol = Chem.MolFromSmiles('CC(Cl)=CF')
mol.GetBondWithIdx(2).SetStereoAtoms(2,4)
mol.GetBondWithIdx(2).SetStereo(Chem.BondStereo.STEREOTRANS)
print(Chem.MolToSmiles(mol))
Chem.AssignStereochemistry(mol, force=True, cleanIt=True)
print(Chem.MolToSmiles(mol))

........

C/C(Cl)=C\F
CC(Cl)=CF

Additionally, I am able to still recapitulate the original problem presented in #1614, namely:

m = Chem.MolFromSmiles('CC(F)=CC(Cl)C')
m.GetAtomWithIdx(4).SetChiralTag(Chem.ChiralType.CHI_TETRAHEDRAL_CW)
assert m.GetBondWithIdx(2).GetBondType() == Chem.BondType.DOUBLE
m.GetBondWithIdx(2).SetStereoAtoms(2, 4)
m.GetBondWithIdx(2).SetStereo(Chem.BondStereo.STEREOCIS)
smi = Chem.MolToSmiles(m, True)
print(smi)
Chem.AssignStereochemistry(m)
print(Chem.MolToSmiles(m, True))
Chem.AssignStereochemistry(m, cleanIt=True)
print(Chem.MolToSmiles(m, True))
Chem.AssignStereochemistry(m, force=True)
print(Chem.MolToSmiles(m, True))
Chem.AssignStereochemistry(m, cleanIt=True, force=True)
print(Chem.MolToSmiles(m, True))
...
C/C(F)=C/[C@H](C)Cl
C/C(F)=C/[C@H](C)Cl
C/C(F)=C/[C@H](C)Cl
C/C(F)=C/[C@H](C)Cl
CC(F)=C[C@H](C)Cl 

In the final line, the valid CIS/TRANS stereochemistry gets removed.
Is this bug still present? Or maybe have I misunderstood something? Thanks for the help.

@bp-kelley
Copy link
Contributor
bp-kelley commented Apr 11, 2019 via email

@yphillip
Copy link
Author

Hmm, still getting the same behavior.

mol = Chem.MolFromSmiles('CC(Cl)=CF')
mol.GetBondWithIdx(2).SetStereoAtoms(2,4)
mol.GetBondWithIdx(2).SetStereo(Chem.BondStereo.STEREOTRANS)
print(Chem.MolToSmiles(mol, isomericSmiles=True))
Chem.AssignStereochemistry(mol, force=True, cleanIt=True)
print(Chem.MolToSmiles(mol, isomericSmiles=True))
.............
C/C(Cl)=C\F
CC(Cl)=CF

@d-b-w
Copy link
Collaborator
d-b-w commented Apr 15, 2019

I think that AssignStereochemistry is getting the bond stereo from the directions of the bonds adjacent to the double bond. I don't currently understand which of these two mechanisms should be considered canonical:

>>> from rdkit import Chem
>>> mol = Chem.MolFromSmiles('CC(Cl)=CF')
>>> mol.GetBondWithIdx(2).SetStereoAtoms(2,4)
>>> mol.GetBondWithIdx(2).SetStereo(Chem.BondStereo.STEREOTRANS)
>>> print(Chem.MolToSmiles(mol))
C/C(Cl)=C\F
>>> Chem.AssignStereochemistry(mol, force=True, cleanIt=True)
>>> print(Chem.MolToSmiles(mol, isomericSmiles=True))
CC(Cl)=CF
>>> mol.GetBondBetweenAtoms(1, 2).SetBondDir(Chem.rdchem.BondDir.ENDDOWNRIGHT)
>>> mol.GetBondBetweenAtoms(3, 4).SetBondDir(Chem.rdchem.BondDir.ENDUPRIGHT)
>>> print(Chem.MolToSmiles(mol))
CC(Cl)=CF
>>> Chem.AssignStereochemistry(mol, force=True, cleanIt=True)
>>> print(Chem.MolToSmiles(mol))
C/C(Cl)=C\F
>>> Chem.AssignStereochemistry(mol, force=True, cleanIt=True)
>>> print(Chem.MolToSmiles(mol))
C/C(Cl)=C\F

@yphillip
Copy link
Author

That's good insight, d-b-w, thanks for that.
I'm hoping that STEREOTRANS/STEREOCIS + setting the stereoatoms will become fully supported, and that I won't need to resort to dealing with the ENDDOWNRIGHT/ENDUPRIGHT system.

There's a thread in the mailing list that discusses the different ways double bond stereochem is handled: https://sourceforge.net/p/rdkit/mailman/message/36484682/. My impression from that thread is there might still be some bugs with using STEREOTRANS/STEREOCIS to set double bond stereochemistry.

@d-b-w
Copy link
Collaborator
d-b-w commented Apr 15, 2019

Heh, I responded to that thread... Also I posted https://sourceforge.net/p/rdkit/mailman/message/36635528/ more recently about issues specifically with reactions.

@greglandrum
Copy link
Member

I think the current behavior of AssignStereochemistry() - clearing the stereo of double bonds that have STEREOCIS or STEREOTRANS set but that don't have wedged bonds - is a bug.

Of course this is one of those things where fixing it may open a giant can of worms and result in me immediately deciding that it's "by design". ;-)

@greglandrum
Copy link
Member

The historical reason this happens is because the old STEREOE/STEREOZ approach is kind of stupid and we bolted the STEREOCIS/STEREOTRANS thing (which is theoretically much simpler) on later. Clearly we still haven't managed to get all the bolts completely tight.

Copy link
Contributor
github-actions bot commented Dec 6, 2024

This issue was marked as stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale label Dec 6, 2024
Copy link
Contributor

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 21, 2024
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

4 participants
0