Dear James,

On Fri, Oct 5, 2012 at 5:27 PM, James Davidson <[email protected]> wrote:
>
> One of my colleagues has been trying to use the RDKit to process some
> intramolecular reactions (ring-closing metatheses).  It seems, however, that
> what Daylight would refer to as “zero-level parentheses” are not supported
> in RDKit reaction SMARTS(?)

Correct. They are not currently supported in either SMARTS or reaction SMARTS.

> ---------------------------------------------------------------------------
>
> ValueError                                Traceback (most recent call last)
>
> C:\Users\j.davidson\<ipython-input-5-054bfc0441df> in <module>()
>
>       1 from rdkit import Chem
>
>       2 from rdkit.Chem import AllChem, Draw
>
> ----> 3 rxn1 =
> AllChem.ReactionFromSmarts("([C:1]=[C;H2].[C:2]=[C;H2])>>[*:1]=[*:2]")
>
>       4 rxn1
>
>       5
>
>
>
> ValueError: ChemicalReactionParserException: Problems constructing reactant
> from SMARTS: ([C:1]=[C;H2]
>
>
>
>
>
> To explain a little further by example (from the Daylight manual) – here is
> how intra-molecular vs inter-molecular reactions can be specified /
> distinguished with zero-level parentheses:
>
>
>
> C(=O)O.OCC>>C(=O)OCC.O          Matches esterifications
>
> (C(=O)O).(OCC)>>C(=O)OCC.O     Matches intermolecular esterifications
>
> (C(=O)O.OCC)>>C(=O)OCC.O       Matches intramolecular esterifications
> (lactonizations)
>
>
>
>
>
> Is there a workaround to this, and if not is this reaction behaviour
> something that should be added in the future?

I have to think about it a bit more, but I believe that getting the
correct behavior in the SMARTS matcher is going to be difficult (this
is why it's not already supported). However, modifying the Reaction
SMARTS parser so that it allows you to do intra-molecular reactions is
certainly doable for the next release. It won't be perfect (if you
have two components in the single reactant, the matches in that
reactant won't be limited to a single component), but it should handle
most cases.

-greg

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to