Re: [Rdkit-discuss] Building a molecule from scratch
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
From: Noel O'B. <bao...@gm...> - 2008-04-15 21:47:11
|
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? Noel |