On Tue, Oct 17, 2017 at 8:16 PM, Chris Murphy <chris.mur...@schrodinger.com>
wrote:
>
> I am trying to implement a function that cleans up chiral centers by
> moving the wedged/dashed stereo bond out of a ring and onto a function
> group or hydrogen if possible.
>
As a general thing: the existing function Chem.WedgeMolBonds() should
already handle assigning wedged bonds to exocyclic atoms. It does not,
however, remove existing wedging. I think that this is probably what you
should be using, but for that to be useful you first need to have a
molecule with atomic stereochemistry assigned and wedging info removed from
bonds.
If you skip sanitization when processing a mol block (which is what I
suspect based on your previous messages), you end up with a molecule that
has the atomic stereochemistry assigned, but with the wedging information
still there. Removing the existing wedging info and then calling
Chem.WedgeMolBonds() should get you what you're looking for.
The function to remove bond wedging isn't currently exposed to Python, I
can do that, but in the meantime a python translation isn't complicated:
In [42]: def ClearSingleBondDirFlags(m):
...: for bond in m.GetBonds():
...: if bond.GetBondType() == Chem.BondType.SINGLE:
...: if bond.GetBondDir() == Chem.BondDir.UNKNOWN:
...: bond.SetProp("_UnknownStereo",1)
...: bond.SetBondDir(Chem.BondDir.NONE)
The piece with the _UnknownStereo property is important to make sure info
about wavy (I call them "squiggle") bonds is maintained.
If the combination of this function and Chem.WedgeMolBonds() isn't enough
to solve the problem, I'll get into the rest of your question, but I
think/hope that this might do it and save you some time and effort.
P.S. If anyone could offer a good suggestion for how to determine if the
> bond I am moving the dash/wedge to should be dashed or wedged that would
> also be super helpful.
>
That's a non-trivial bit of C++ code that isn't currently exposed to the
python interface. I don't think it would be hard to do that if it would be
helpful.
-greg
> I have been able to successfully identify the wedged bonds and the
> adjacent bond to move the wedge/dash stereo bond to and move the stereo
> bond off of the ring bond, but when I check the result, I notice that I
> assigned the wrong wedge/dash form to one of the bonds, so I want to check
> the chirality of the atoms after doing my changes and flip the ones that
> are wrong.
>
> However, I am noticing that the output of Chem.FindMolChiralCenters(mol)
> does not change (as well as atom.GetProp('_CIPCode')), even if I change all
> of the bonds to either dashed or wedged, or another combination that should
> clearly change the original chirality of the stereocenters. I tried
> calling rdmolops.AssignStereochemistry(mol), but the result of
> FindMolChiralCenters and atom.GetProp('_CIPCode') still does not change.
>
> Does SetBondDir actually affect the R/S chiral tags on the atoms? Is there
> a good way to check if the changes in the bonds have changed the chirality
> at a given chiral center?
>
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss