Re: [Rdkit-discuss] Building a molecule from scratch
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
From: Greg L. <gre...@gm...> - 2008-04-16 03:55:26
|
On Tue, Apr 15, 2008 at 11:47 PM, Noel O'Boyle <bao...@gm...> wrote: > On 15/04/2008, Greg Landrum <gre...@gm...> wrote: > > The problem is here. I shouldn't even have exposed SetStereo to > > Python. To indicate bond stereochemistry, you need to set the > > directionalities of the neighboring single bonds. So you'd do: > > [13] >>> rdmol.GetBondWithIdx(0).SetBondDir(Chem.BondDir.ENDUPRIGHT) > > [15] >>> rdmol.GetBondWithIdx(2).SetBondDir(Chem.BondDir.ENDUPRIGHT) > > > > Notice that this does not set the stereochemistry of the double bond: > > > > [16] >>> rdmol.GetBondWithIdx(1).GetStereo() > > Out[16]: Chem.rdchem.BondStereo.STEREONONE > > > > The RDKit is, at the moment, lazy about stereochemistry : it doesn't > > do the perception until it's required. So if you ask for SMILES: > > > > [17] >>> Chem.MolToSmiles(rdmol,True) > > Out[17]: 'F/C=C/F' > > > > you get stereochemistry calculated: > > [18] >>> rdmol.GetBondWithIdx(1).GetStereo() > > Out[18]: Chem.rdchem.BondStereo.STEREOE > > > > If you want the stereochem information earlier, you can call: > > Chem.AssignBondStereoCodes(rdmol) > > I'm afraid that the chunks are still too big - you need to break it > down a bit more... > > What exactly do UPRIGHT and DOWNRIGHT mean and how exactly do they > indicate the stereochemistry of the double bond? Do they correspond to > the SMILES usage of slashes? Exactly. Since Z/E labels are only defined when you have the whole molecule built (because you need to be able to assign priorities to the atoms), that's done "at the end". Stereochemistry about the double bond is defined at construction time using the SMILES approach of indicating the directionality of the neighboring single bonds. The two possible labels for this are ENDUPRIGHT (forwards slash: "/") and ENDDOWNRIGHT (backwards slash: "\"). The stereochemistry perception done by Chem.AssignBondStereoCodes uses these directionality indicators and the atomic CIP ranks to determine the absolute (Z/E) stereochemistry of the double bond. Note that, as in SMILES, you only need to provide the directionality of one neighbor bond on each side of the double bond. So "C/C(Cl)=C(/C)" is fine, you don't need to provide a direction on the C1-Cl2 bond (and probably shouldn't, since that just increases the chance of errors). Does that help? -greg |