Hello Greg,

i’m tracking also your algorithm now. 

https://github.com/rdkit/rdkit-orig/blob/master/Code/GraphMol/Chirality.cpp 
<https://github.com/rdkit/rdkit-orig/blob/master/Code/GraphMol/Chirality.cpp>

There is an other problem… when EmbedMultipleConfs generate conformations some 
times could happens that the stereochemistry is inverted… so reading your 
algorithm you do not consider the atom position when you check for 
stereochemistry,  but also in Chirality.cpp there is an interesting function:

void assignChiralTypesFrom3D(ROMol &mol,int confId,bool replaceExistingTags);

However i see that this function is not documented and utilised in the 
FindMolChiralCenters. 

So what do you think about this?


Best regards,
GMR



> On 11 Jan 2015, at 18:00, Greg Landrum <greg.land...@gmail.com> wrote:
> 
> Hi,
> 
> I am able to reproduce this. Here's a somewhat simpler way of doing so:
> 
> In [17]: m = 
> Chem.MolFromSmiles("C1C[C@H](C[C@@H]2[C@]1([C@@H]1[C@@H](CC2)[C@H]2[C@](CC1=O)([C@](CC2)([C@@H](O)CO)O)C)C)O")
> 
> In [18]: cids=AllChem.EmbedMultipleConfs(m, 30, randomSeed=0xf00d)
> 
> In [19]: for cid in cids:
>     nm = Chem.Mol(m.ToBinary())
>     Chem.AssignAtomChiralTagsFromStructure(nm,confId=cid)
>     cchirality = Chem.FindMolChiralCenters(nm,force=True)
>     if cchirality != mchirality:
>         mm = [(x,y) for x,y in zip(mchirality,cchirality) if x!=y]
>         print("problem: ",mm)
>    ....:         
> problem:  [((11, 'S'), (11, 'R'))]
> problem:  [((15, 'R'), (15, 'S'))]
> problem:  [((5, 'S'), (5, 'R')), ((11, 'S'), (11, 'R'))]
> 
> I will see if I can track the problem down and fix it.
> 
> Best,
> -greg
> 
> 
> 
> On Sat, Jan 10, 2015 at 7:30 PM, Giuseppe Marco Randazzo 
> <gmranda...@gmail.com <mailto:gmranda...@gmail.com>> wrote:
> Hello Greg,
> 
> and hello to all other developers.
> 
> Thanks for this nice package that i enjoy and i love a lot!!! So.. i’ve 
> noticed maybe a bug in the stereocenter preservation when more conformer are 
> generated with “EmbedMultipleConfs”
> 
> Here my example with a  simple steroid alpha cortolone.
> 
> Is it normal? or there is something wrong?
> 
> Best regards
> GMR
> 
> 
> 
> from rdkit import Chem
> from rdkit.Chem import AllChem
> 
> m = 
> Chem.MolFromSmiles("C1C[C@H](C[C@@H]2[C@]1([C@@H]1[C@@H](CC2)[C@H]2[C@](CC1=O)([C@](CC2)([C@@H](O)CO)O)C)C)O")
> mchirality = Chem.FindMolChiralCenters(m)
> AllChem.EmbedMultipleConfs(m, 300)
> 
> example = Chem.SDWriter("Example.sdf")
> for i in range(m.GetNumConformers()):
>     Chem.AssignAtomChiralTagsFromStructure(m, confId=i)
>     AllChem.UFFOptimizeMolecule(m,confId=i)
>     example.write(m, confId=i)
> example.flush()
> 
> suppl = Chem.SDMolSupplier("Example.sdf")
> for molid in range(len(suppl)):
>     confchirality = Chem.FindMolChiralCenters(suppl[molid])
>     problems = False
>     for i in range(len(confchirality)):
>         if mchirality[i] == confchirality[i]:
>           continue
>         else:
>           problems = True
>           break
>     if problems == True:
>         print "Warning Different Chirality in Conformer %d" % molid
>         print mchirality
>         print confchirality
>         print "-"*100
>     else:
>         continue
> 
> 
> 
> 
> 
> Warning Different Chirality in Conformer 25
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'R'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 44
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'R'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 67
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'R'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 87
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'R'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 95
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'R'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 100
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'S'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 101
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'R'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 102
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'S'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 108
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'R'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 114
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'R'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 144
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'R'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 149
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'R'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 166
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'R'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 170
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'R'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 174
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'R'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 196
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'R'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 214
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'R'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 240
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'R'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 251
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'R'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 252
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'R'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 260
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'R'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 286
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'R'), (15, 
> 'R'), (18, 'S')]
> ----------------------------------------------------------------------------------------------------
> Warning Different Chirality in Conformer 297
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'R'), (18, 'S')]
> [(2, 'R'), (4, 'R'), (5, 'S'), (6, 'S'), (7, 'S'), (10, 'S'), (11, 'S'), (15, 
> 'S'), (18, 'S')]
> 
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net 
> <http://goparallel.sourceforge.net/>
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net 
> <mailto:Rdkit-discuss@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss 
> <https://lists.sourceforge.net/lists/listinfo/rdkit-discuss>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to