Dear Jameed,
On Wed, Jan 9, 2013 at 4:33 PM, Jameed Hussain <[email protected]>wrote: > > > I’ve just come across this behaviour in RDKit regarding SMARTS parsing: > > > > The following SMARTS works fine: > > [#0].[#0] > > > > >>> from rdkit import Chem > > >>> Chem.MolFromSmarts("[#0].[#0]") > > <rdkit.Chem.rdchem.Mol object at 0x9e228a0> > > > > But the same SMARTS in a recursive SMARTS doesn’t work: > > >>> Chem.MolFromSmarts("[$([#0].[#0])]") > > [15:26:45] SMARTS Parse Error: syntax error for input: [$([#0].[#0])] > > I can confirm the behavior and that it's what I'd expect from the way the SMARTS grammar is expressed in the code. That's not to say that it's right, of course, it's just what's in the code. [It's a legacy of the fact that the SMARTS parser is derived from the SMILES parser] > Are component SMARTS in a recursive SMARTS supported in RDKit ? Does > anyone know how I construct a SMARTS like that for RDKit ? > Component-level grouping, as described in section 4.5 here: http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html, is definitely not supported. I believe that the query you are expressing above should work and I also think that it's a relatively straightforward fix. But the parser is complex enough that I'm going to have to actually try it out to be sure. -greg
------------------------------------------------------------------------------ Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612
_______________________________________________ Rdkit-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

