Re: [Rdkit-discuss] need SMARTS query with a specific exclusion

2017-09-24 Thread David Cosgrove
Hi Chris, Sure they're equivalent, but with my suggestion you don't have to create all 6 different SMARTS patterns, which whilst not difficult is likely to be prone to silly errors. You can stick a long list of OR'd vector bindings together to put in all the exclusions you want on each atom as

Re: [Rdkit-discuss] need SMARTS query with a specific exclusion

2017-09-24 Thread Chris Earnshaw
Hi It amounts to the same thing - either do all tests on one atom, or one test on all atoms. The syntax is shorter for the latter if you can use the vector bindings but may not be otherwise, especially if multiple exclusions are needed. Regards, Chris Earnshaw On 24 Sep 2017 16:54, "David

Re: [Rdkit-discuss] need SMARTS query with a specific exclusion

2017-09-24 Thread David Cosgrove
Hi, I think Chris' solution is a bit overly complicated, though I haven't tested my alternative. If each atom in the ring is tested for '[$(a);!$(n1(C)ccc(=O)nc1=O)]', as you'd get if you expanded out the vector bindings I provided previously, then I don't think you need to provide the SMARTS for

Re: [Rdkit-discuss] need SMARTS query with a specific exclusion

2017-09-24 Thread Chris Earnshaw
Hi Jim The key thing to remember about the recursive SMARTS clauses is that they only match one atom (the first), and the rest of the string describes the environment in which that atom is located. So the clause $(n1(C)ccc(=O)nc1=O) matches just the nitrogen atom - which has embedded in the rest

Re: [Rdkit-discuss] need SMARTS query with a specific exclusion

2017-09-24 Thread David Cosgrove
Hi Jim, As a slight aside, this sort of thing demonstrates the value of what Daylight used to call vector bindings ( http://www.daylight.com/dayhtml/doc/prog/prog.smarts.html#9.3) and which one might these days call a macro. For example, in the Daylight toolkit you could bind the label HAL to

Re: [Rdkit-discuss] need SMARTS query with a specific exclusion

2017-09-24 Thread James T. Metz via Rdkit-discuss
Chris, Wow! Your recursive SMARTS expression works as needed! Hmmm... Help me understand this better ... it looks like you "walk around" the ring of the substructure we want to exclude and employ a slightly different recursive SMARTS beginning at that atom. Is that correct? Also, since my

Re: [Rdkit-discuss] Drawing options for the new drawing code to change background color

2017-09-24 Thread MichaƂ Nowotka
Great, thanks a lot again :) On Sun, Sep 24, 2017 at 4:33 AM, Greg Landrum wrote: > As I was composing this email there was a voice in the back of my head > saying "you can do that already...", but when I looked through the code for > "transparent" I didn't find anything,

Re: [Rdkit-discuss] need SMARTS query with a specific exclusion

2017-09-24 Thread Chris Earnshaw
Hi Jim It can be done with recursive SMARTS, though the syntax is a bit painful This may do what you want - [$(a);!$(n1(C)ccc(=O)nc1=O);!$(c1cc(=O)nc(=O)n1C);!$(c1c(=O)nc(=O)n(C)c1);!$(c(=O)1nc(=O)n(C)cc1);!$(n1c(=O)n(C)ccc1=O);!$(c(=O)1n(C)ccc(=O)n1)]:1:a:a:a:a:a:1 Its basically the general