HI Robert,

On Thu, Feb 7, 2013 at 7:42 PM, Robert Feinstein <[email protected]> wrote:
>
> When a reaction transform includes an atom that is not modified, it still
> replaces that atom such that its attributes are lost. Specifically, when you
> react a chiral reactant, if an atom in the transform maps to the
> stereocenter, the resulting product includes that atom (as it should) but it
> has lost (or failed to copy over) the attributes of the reactant's atom
> (i.e. chirality).

The reaction code does bring over atomic attributes like isotope, but
there are problems with chirality.

> 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 probably a simple way to avoid this. Ideally (in my opinion) RDKit
> should handle this by having rxn.RunReactants() use rxn.GetReactingAtoms()
> and, if at atom is not reacting (i.e. changing), be sure to copy all its
> attributes from the mapped-to reactant atom onto the corresponding product
> atom.

The idea is right, but the implementation isn't quite that simple due
to the way stereochemistry is represented internally.

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.

> However, in the simple example above, rxn.GetReactingAtoms() indicates
> that atoms 1 and 2 are both reacting even though atom 2 doesn't change at
> all.

This one, at least, is not a bug: atoms are numbered from zero. :-)

-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