Skip to content

cis trans information #5037

Feb 23, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

I'll leave writing the actual code to you, but here's how to get the information you need:

In [35]: m = Chem.MolFromSmiles('C/C(F)=C(Cl)/C')

In [36]: bnd = m.GetBondWithIdx(2)

In [37]: bnd.GetStereo()
Out[37]: rdkit.Chem.rdchem.BondStereo.STEREOE

In [38]: bnd.GetStereoAtoms()
Out[38]: <rdkit.rdBase._vectint at 0x1d8a4d66d60>

In [39]: list(bnd.GetStereoAtoms())
Out[39]: [2, 4]
#   ^^^ Based upon this you know that atoms 2 and 4 are trans ("E") from each other across the double bond

Here's how to find the other atoms connected to the two ends of the bond:

In [40]: beginNbrs = [x for x in bnd.GetBeginAtom().GetNeighbors() if x.GetIdx()!=bnd.GetEndAtomIdx()]

In [41]: beginNbrs = [x.GetI…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@manajit-das
Comment options

Answer selected by manajit-das
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants