Hi Ben,
On Sun, Sep 22, 2013 at 5:10 AM, Fulton, Ben <[email protected]> wrote:
>
> I've just been experimenting with the RDKit for parsing Smarts strings in
> Python. It's very nice!
>
>
Glad to hear it!
> I ran into problems, though, with the following strings, which I copied
> from a paper:
>
> Chem.MolFromSmarts("[Cl,Br,I]C(([F,Cl,Br,I])[X1])C=C")
> Chem.MolFromSmarts("[Cl,Br,I]C(([F,Cl,Br,I])[X1])C(=O)[c,C]")
>
> Chem.MolFromSmarts("[$([C,c]OS((=O)=O)O!@[c,C]),$([c,C]S((=O)=O)O!@[c,C])]")
>
> I get this trace:
>
> [19:22:38] SMARTS Parse Error: syntax error while parsing:
> [Cl,Br,I]C(([F,Cl,Br,I])[X1])C=C
> [19:22:38] SMARTS Parse Error: syntax error while parsing:
> [Cl,Br,I]C(([F,Cl,Br,I])[X1])C(=O)[c,C]
> [19:22:38] SMARTS Parse Error: syntax error while parsing:
> [$([C,c]OS((=O)=O)O!@[c,C])_100,$([c,C]S((=O)=O)O!@[c,C])_101]
>
>
> I wouldn't be surprised if there are errors in the strings, but I don't
> see them. Any help?
>
The thing the RDKit doesn't like is the branch at the beginning of a branch.
So this is an error:
Chem.MolFromSmarts("[Cl,Br,I]C(([F,Cl,Br,I])[X1])C=C")
But this is not:
Chem.MolFromSmarts("[Cl,Br,I]C([F,Cl,Br,I])([X1])C=C")
I just did some experimenting with Daylight's depictmatch. It supports the
form you use, so it looks like this is a bug in the RDKit parser. I have to
check the parser code, but I don't think this is going to be quick to fix.
The rewritten SMARTS that should work for you are:
"[Cl,Br,I]C([F,Cl,Br,I])([X1])C=C"
"[Cl,Br,I]C([F,Cl,Br,I])([X1])C(=O)[c,C]"
"[$([C,c]OS(=O)(=O)O!@[c,C]),$([c,C]S(=O)(=O)O!@[c,C])]"
-greg
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss