Re: [Rdkit-discuss] Behaviour change between RDKit versions (HasSubstructMatch)
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Greg L. <gre...@gm...> - 2014-06-20 10:03:30
|
Hi JP,
On Thu, Jun 19, 2014 at 7:58 PM, JP <jea...@in...> wrote:
>
> yo RDKitters,
>
> writing this email while waiting eagerly for the Uruguay-England match in
> an hour or so (blame the beer for any lack of consistency beneath).
>
I guess more beer probably followed afterwards to lessen the pain... ouch.
> Can someone explain which changes in the new RDKit result in the following
> behaviour change. Somehow "all" (as in all five of them) my tests are
> failing now - which is fine, I'll change my code to use MolFromSmarts
> instead (this works).
>
> Using RDKit_2013_09_2:
>
> >>> import rdkit
> >>> from rdkit import Chem
> >>> mol = Chem.MolFromSmiles('CCN=[N+]=[N-]')
> >>> npos = Chem.MolFromSmiles("[N+]")
> >>> mol.HasSubstructMatch(npos)
> True
>
> Using RDKit_2014_03_1
>
> >>> import rdkit
> >>> from rdkit import Chem
> >>> mol = Chem.MolFromSmiles('CCN=[N+]=[N-]')
> >>> npos = Chem.MolFromSmiles("[N+]")
> >>> mol.HasSubstructMatch(npos)
> False
>
> mol.Debug() and npos.Debug() seem to be giving me the same output in both
> versions. I understand the workaround (which is go with MolFromSmarts,
> which creates QueryAtoms), but I'd like to understand what is going on
> behind the scenes which triggered the behaviour change.
>
It was this bug:
https://github.com/rdkit/rdkit/issues/165
Essentially: "[N+]" has radical electrons, so it doesn't match the N+ in
'CCN=[N+]=[N-]'
-greg
|