On Wed, Oct 30, 2019 at 10:28 AM Lukas Pravda <lpra...@ebi.ac.uk> wrote:
> > Thank you for the answer. I used to use the stereochemistry assignment the > way you describe, but someone complained that in one of the molecules they > knew the stereochemistry was incorrect. > Do you mean the R/S labels were incorrect or that somehow the structure (or perhaps the drawing of the structure) was wrong? The first is not completely unexpected given that the algorithm used to assign CIP labels is approximate. This is fixable by doing an implementation following the guidelines in the paper I link to below, but that is a decidedly non-trivial amount of work. A problem with the structure (or the way it's drawn), on the other hand, would be a bug that is probably more easily fixable. A question I should probably ask: why do you actually need R/S labels? > It was suggested that we use the stereochemistry we have in db, so I > changed that to setting atom tags (which randomly fixed those couple of > issues, but apparently broke everything else down. > > I was wondering how does rdkit work out R/S from inchi string? > The InChI code translates InChI string into a datastructure that the RDKit interprets to create an RDKit molecule. This datastructure includes parity information analogous to what the RDKit uses internally (though based on atom order if I remember correctly). Once we have an RDKit molecule AssignStereochemistry() is called to set the approximate R/S labels. -greg > > > Lukas > > > > *From: *Greg Landrum <greg.land...@gmail.com> > *Date: *Wednesday, 30 October 2019 at 04:28 > *To: *Lukas Pravda <lpra...@ebi.ac.uk> > *Cc: *RDKIT mailing list <rdkit-discuss@lists.sourceforge.net> > *Subject: *Re: [Rdkit-discuss] Stereochemistry in rdkit > > > > Hi Lukas, > > > > The stereochemistry tags that the RDKit uses in determining bond wedging > (or for SMILES, generating 3D coordinates, etc.) are the ChiralTags on the > atoms: CHI_TETRAHEDRAL_CW and CHI_TETRAHEDRAL_CCW. The current RDKit stereo > representation is relative to the ordering of the bonds around an atom, not > the ordering of neighboring atoms. So CHI_TETRAHEDRAL_CW means that when > you look down the first bond towards the central atom you rotate clockwise > to move from the second bond to the third. > > > > The CIP (R/S) atomic properties are set by AssignStereochemistry() using > the ChiralTags. Note that the R/S assignments are only approximate, the > actual CIP rules are quite complex (great paper on this here: > https://pubs.acs.org/doi/abs/10.1021/acs.jcim.8b00324) and we've not made > a serious attempt to get this right. > > > > It isn't currently possible to assign CIP R/S labels to atoms and use > those to set the ChiralTags. It would be possible to put together a bit of > Python that can do this, but it would only be as accurate as the RDKit's > assignment of CIP priorities. I can put together a demo of how to do this, > but I think/hope it's not actually what you need... > > > > If you have 3D coordinates, the absolute best way to set the ChiralTags > (and thus have the chiral representation correct) is to use > AssignStereochemistryFrom3D(). This will set the ChiralTags on the atoms as > well as assigning the CIP codes (to the extent that those are correct). > Here's a gist showing how this works: > > https://gist.github.com/greglandrum/aa802edd1bc49ac55550452beff52d55 > > > > I hope this helps, > > -greg > > > > > > > > On Tue, Oct 29, 2019 at 12:13 PM Lukas Pravda <lpra...@ebi.ac.uk> wrote: > > Hi guys, > > > > I got completely puzzled by stereochemistry and the way to set it in > rdkit. Among others we use rdkit to get 2D depictions. What I do in my code > is that I construct molecule from scratch and set chiral tags to > CHI_TETRAHEDRAL_CW for R, CHI_TETRAHEDRAL_CCW for S (this is the metadata > we have for each atom, where applicable), otherwise CHI_UNSPECIFIED. Then I > run sanitization on the molecule and generate images. That seems to be > working incorrectly even for simple cases: e.g.: > https://pdbe.org/chem/004 > > > > When constructing the molecule I set the stereocenter for the CA atom to > CHI_TETRAHEDRAL_CCW (S), but when I then try to perceive the R/S by > FindMolChiralCenters(force=false) it says ‘R’, so as the image. This is > wrong. I can also directly set _CIPCODE for each atom where applicable to > S/R directly (along with the chiral tags). Then the chiral atom is > perceived as S by FindMolChiralCenters(force=false), but then again the > image still says R. > > > > When I set neither the chiral tag nor the _CIPCODe and run > AssignAtomChiralTagsFromStructure() and AssignStereochemistry() on the > mol the atom under question gets atom tag CHI_TETRAHEDRAL_CW (I assume > incorrectly), the _CIPCODE is correct (S) and the image is correct > (why????) as well (attached). So my question is, how do I set > stereochemistry on individual atoms, so that it is perceived by rdkit and > is not overwritten in any subsequent step. > > > > I hope the above mentioned description makes at least some sense. If not, > I’ll try to distill a code sample for constructing this molecule from raw > data. > > > > I also reproduced the same steps on the http://pdbe.org/chem/THR, which > also gives wrong results when I set chiral tags manually (bond wedging > should not be on methyl group I assume. Interestingly here the setting > chiral atoms from the structure by rdkit gives incorrect results as well > (attached). > > > > For rdkit set tags I get > > > > CA - CHI_TETRAHEDRAL_CCW (S) – (correct) > > CB - CHI_TETRAHEDRAL_CCW (R) – (incorrect should be TETRAHEDRAL_CW - R) > > > > I’d be grateful for any piece of advice. Because I have no idea what I > have been doing wrong the whole time. > > > > My settings: > > Rdkit: 2019.09.1/2019.03.2 > > Conda: 4.7.12 > > Python 3.7.4 > > os mac 10.15 > > > > Best, > > Lukas > > > > > > _______________________________________________ > Rdkit-discuss mailing list > Rdkit-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss > >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss