Closed ravenlocke closed 7 years ago
To do query-query comparisons correctly (well, mostly correctly), you need to use the useQueryQueryMatches
argument to HasSubstrutMatch()
.
Here's an example on my linux box, the homebrew install should work the same:
In [13]: x = Chem.MolFromSmarts('[#15]-[#8-]')
In [14]: y = Chem.MolFromSmarts('[#15]-[#8-]')
In [15]: x.HasSubstructMatch(y)
Out[15]: False
In [16]: x.HasSubstructMatch(y,useQueryQueryMatches=True)
Out[16]: True
Hi all,
I'm a little new to rdkit, so apologies if this is an issue that's either been noted before, or just a result of me doing something completely wrong!
Essentially, I'm just using substructure matching to compare two bonds, but the version that I acquired via home-brew seems to struggle with the following example. This has worked with other versions (e.g., the version I have on a linux VM, which I think I built from source), but not this one:
Unless I misunderstand how these functions are meant to work, I believe this should return True, not False?