On Fri, Feb 8, 2013 at 5:22 AM, Greg Landrum <[email protected]> wrote:
> HI Robert,
>
> On Thu, Feb 7, 2013 at 7:42 PM, Robert Feinstein <[email protected]> wrote:
>
>> Here is some code to illustrate the problem:
>>
>> # Demo of RDKit reaction transform nuking stereocenters
>> from rdkit import Chem
>> from rdkit.Chem import AllChem
>>
>> # Define simple transform that includes possible stereocenter ([C:2])
>> rxn = AllChem.ReactionFromSmarts('[C:2][C:1]=O>>[C:2][C:1]=S')
>>
>> # React achiral mol as test
>> ps = rxn.RunReactants((Chem.MolFromSmiles('CC=O'),))
>> Chem.MolToSmiles( ps[0][0], isomericSmiles=True )
>> # Output is 'CC=S'
>>
>> # React mol with chiral center far removed
>> ps = rxn.RunReactants((Chem.MolFromSmiles('[Cl][C@H]([Br])CCCC=O'),))
>> Chem.MolToSmiles( ps[0][0], isomericSmiles=True )
>> # Output is 'S=CCCC[C@H](Cl)Br'
>>
>> # React mol with chiral center included in transform component
>> ps = rxn.RunReactants((Chem.MolFromSmiles('[Cl][C@H](C=O)'),))
>> Chem.MolToSmiles( ps[0][0], isomericSmiles=True )
>> # Output is 'S=CCCl' - chriality has been lost.
>>
>
> That's certainly a bug in the reaction code, thanks for reporting it.

There is actually a problem in the above example: the input molecule
isn't chiral (the chiral C is only 3-coordinate), but that doesn't
change the fact that there was a bug. :-)

>
> This is one of those "not so easy to fix" things, so it probably won't
> be fixed in the next couple of days, but I will definitely try to get
> it done before the next release.

It turned out to be a lot easier than I anticipated. I just checked in
a fix that clears up the above problem:

In [12]: rxn = AllChem.ReactionFromSmarts('[C:2][C:1]=O>>[C:2][C:1]=S')

In [13]: ps = rxn.RunReactants((Chem.MolFromSmiles('[Cl][C@H](C=O)F'),))

In [14]: Chem.MolToSmiles( ps[0][0], isomericSmiles=True )
Out[14]: 'F[C@H](Cl)C=S'

I need to do more testing to be sure of this, but it's available for
testing now if anyone wants to give it a try.

-greg

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to