Hi Ivan,

On Wed, Mar 7, 2018 at 8:58 PM, Ivan Tubert-Brohman <
ivan.tubert-broh...@schrodinger.com> wrote:

>
> Is it reasonable to expect that a SMARTS should match itself when
> useQueryQueryMatches=True?
>

Not my favorite kind of answer to give, but... "it depends"


>   query = Chem.MolFromSmarts('[C;!$(C=O)]Cl')
>   query.HasSubstructMatch(query, useQueryQueryMatches=True)
>
> The above returns False. Without useQueryQueryMatches, it returns True,
> but I think I need useQueryQueryMatches for my application because
> queries are not generally valid molecules, and in some cases
> HasSubstructMatch ends up raising exceptions (for example when the SMARTS
> specifies hydrogen counts).
>
> If I remove the recursive part of the SMARTS above, I get a match, so I
> suspect that the query-query search doesn't play well with recursive SMARTS.
>

That is the expected, though not particularly nice, behavior. The code is
currently quite conservative about when it says that two queries match each
other: if it sees a recursive query it just says "no".
There may be a straightforward fix for this, but in general making the
query-query matcher more flexible is one of those "it would be so cool, but
it's soooo much work" projects, so I'm not going to make any promises.

Best,
-greg




> Best,
> Ivan
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to