[Rdkit-devel] Canonical representation of Bond stereochemistry
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Dan W. <dan...@sc...> - 2019-04-09 22:10:59
|
I'm curious about what I should be using to set and get double bond
stereochemistry. Is it the bond stereo of the double bond, or the bond
directions of the adjacent bonds?
I've been in-memory translating Mol objects into our internal
representation of a molecule. I've been using the Bond::getStereo() and
Bond::setStereo() to get and set bond stereochemistry.
Recently, I noticed that the products of RDKit reactions seem to
consistently not have bond stereo set. They have bond directions, though.
Here's a demonstration:
from rdkit import Chem
from rdkit.Chem import AllChem
import rdkit.Chem.rdchem
mol = Chem.MolFromSmiles(r'F/C=C/F')
rxn = AllChem.ReactionFromSmarts('[C:1]>>[C:1]')
product = rxn.RunReactants([mol])[0][0]
assert mol.GetBondBetweenAtoms(1, 2).GetStereo() ==
rdkit.Chem.rdchem.BondStereo.STEREOE
assert product.GetBondBetweenAtoms(0, 2).GetBondType() ==
rdkit.Chem.rdchem.BondType.DOUBLE
print(Chem.MolToSmiles(product))
print(product.GetBondBetweenAtoms(1, 0).GetBondDir(),
product.GetBondBetweenAtoms(0, 2).GetStereo(),
product.GetBondBetweenAtoms(2, 3).GetBondDir())
# this fails:
assert product.GetBondBetweenAtoms(0, 2).GetStereo() ==
rdkit.Chem.rdchem.BondStereo.STEREOE
I think that this means that I don't understand how I should be using bond
stereochemistry. It's also possible, though, that RxnRunner needs to assign
bond stereo from the bond directions after the reaction.
- dan nealschneider
Senior Developer
Schr*ö*dinger, Inc
Portland, OR
|