Hi Greg,


Thanks for your response.  The RDKit version I was using was an older one
(2012_06_1).  Since we’re not using Python in production, I checked the
current version of the C# wrapper code to see if the problem was still
there, but didn’t bother to check the latest Python wrappers.



It’s good to know that I’m not actually doing something wrong.  I’ll look
into the workaround you suggest for now.



Thanks again,

Bob



*From:* Greg Landrum [mailto:greg.land...@gmail.com]
*Sent:* Thursday, January 01, 2015 11:52 PM
*To:* Bob Funchess
*Cc:* RDKit Discuss
*Subject:* Re: [Rdkit-discuss] Difference in Python / C# wrapper versions



Hi Bob,



On Tue, Dec 30, 2014 at 8:42 PM, Bob Funchess <bfunch...@kelaroo.com> wrote:



We’re using the C# wrappers to RDKit for an enumeration engine and we have
run into an issue with stereochemistry in RDKit.



The basic problem is that when we use a reaction which adds a stereocenter
to a molecule, chirality at carbons that were present in the reactants is
kept, but chirality at carbons introduced by the reaction itself is lost.


In the course of trying to figure this out, I created a Python script that
goes through the steps performed by the enumeration engine for a sample
illustrating the issue so that I could try to debug the problem more
easily, only to find that in Python the chirality is retained throughout
the molecule. I then translated that Python script back into a standalone
C# program … and the problem reappears.



The output molecule should have two chiral centers (the carbon attached to
the fluorine and the carbon attached to the chlorine). The Python version
shows both of these as chiral; the C# version has only the fluorine carbon
as chiral.



Hmm, when I run stereo.py with the 2014.09.2 release of the RDKit I also
only get one stereo-center:

(py34)~/Downloads > python stereo.py

[07:03:18] product atom-mapping number 7 not found in reactants.

[07:03:18] product atom-mapping number 8 not found in reactants.

[07:03:18] product atom-mapping number 9 not found in reactants.

[07:03:18] product atom-mapping number 10 not found in reactants.

[07:03:18] mapped atoms in the reactants were not mapped in the products.

  unmapped numbers are: 6



     RDKit          2D



  9  8  0  0  0  0  0  0  0  0999 V2000

   -3.8971   -0.7500    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0

   -2.5981    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0

   -2.5981    1.5000    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0

   -1.2990   -0.7500    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0

    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0

    1.2990   -0.7500    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0

    2.5981   -0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0

    3.8971   -0.7500    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0

    2.5981    1.5000    0.0000 Cl  0  0  0  0  0  0  0  0  0  0  0  0

  2  1  1  1

  2  3  1  0

  2  4  1  0

  4  5  1  0

  5  6  1  0

  7  6  1  0

  7  8  1  0

  7  9  1  0

M  END



CC(Cl)CCC[C@@H](C)F





This is, I think, more or less what I expect to happen based on the current
state of the code. You need to tell the reaction engine that you want
stereochemistry the stereochemistry you provide in the products to be
maintained. There's an atom property for this, molInversionFlag. Here's an
example of how to set it:



      template_p.GetAtomWithIdx(6).SetProp('molInversionFlag','4')



The attached stereo2.py does this and produces the expected results (I
think).



The current behavior seems like a bug, but I'm going to need to think for a
bit about how to fix it. But at least this may be a workaround for now?





I’ve attached the Python script and the C# source file. The C# version has
the Python commands included as comments for easy comparison.



Does anyone know what’s going on here?  The only significant difference
between the two that I can see is that Python has rxn.Initialize() while C#
has rxn.initReactantMatchers(). Could this be the cause, and if so what C#
method should I be using instead?



ChemicalReaction.Initialize() from Python is just calling
initReactantMatchers(). I guess you were using different versions of the
underlying C++ code.



-greg




------------------------------

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.5577 / Virus Database: 4257/8854 - Release Date: 01/02/15
------------------------------------------------------------------------------
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