Hi Paolo,

Thank you very much for this!  This clarified issues I hadn’t even thought 
about yet 

Cheers
Markus

From: Paolo Tosco <paolo.tosco.m...@gmail.com>
Sent: Tuesday, November 5, 2019 2:49 PM
To: Markus Heller <mhel...@admarebio.com>; rdkit-discuss 
(rdkit-discuss@lists.sourceforge.net) <rdkit-discuss@lists.sourceforge.net>
Subject: Re: [Rdkit-discuss] Explicit H in substructure searches


Hi Markus,

I tried to put together a comprehensible explanation in his gist:

https://gist.github.com/ptosco/1088937ce332bd66c999a2a5fbc855b3

Please also refer to the following threads on the mailing list:

https://sourceforge.net/p/rdkit/mailman/message/29679834/
https://sourceforge.net/p/rdkit/mailman/message/36696340/

and to this blog post by Roger Sayle:

https://nextmovesoftware.com/blog/2013/02/27/explicit-and-implicit-hydrogens-taking-liberties-with-valence/

for further clarifications.

Cheers,
p.
On 05/11/2019 19:52, Markus Heller wrote:
Hi,

I’m trying to understand how to properly use explicit hydrogens in substructure 
searches.  Below is an example.  I would like to find all molecules that 
contain my query with hydrogens at the nitrogens, and I thought I was on the 
right track …  Why does the first query with the explicit H not match m1?

Thanks
Markus

<code>
from rdkit import Chem
from rdkit.Chem.Draw import IPythonConsole
from rdkit.Chem import rdDepictor

rdDepictor.SetPreferCoordGen(True)
IPythonConsole.ipython_useSVG = True

m1 = Chem.MolFromSmiles('c1cn[nH]c1N')
m2 = Chem.MolFromSmiles('CNc1ccn[nH]1')
m3 = Chem.MolFromSmiles('Nc1ccnn(C)1')

# do not remove explicit H
params = Chem.SmilesParserParams()
params.removeHs=False

query = Chem.MolFromSmiles('c1cn[nH]c(N([H])([H]))1', params)

# first should be True, but all are False
m1.HasSubstructMatch(query)
m2.HasSubstructMatch(query)
m3.HasSubstructMatch(query)

# rebuild query with explicit H removed, not what I want
query = Chem.MolFromSmiles('c1cn[nH]c(N([H])([H]))1')

m1.HasSubstructMatch(query)
m2.HasSubstructMatch(query)
m3.HasSubstructMatch(query)

</code>
--
Markus Heller, PhD
Senior Scientist
Direct: 604.827.1122   Main: 604.827.1147

 [A027228F]
2405 Wesbrook Mall, 4th Floor, Vancouver, BC V6T 1Z3

This email and any attachments thereto may contain confidential material for 
the sole use of the intended recipient. Any review, copying, or distribution of 
this email (or any attachments thereto) by others is strictly prohibited. If 
you are not the intended recipient, please contact the sender immediately and 
permanently delete the original and any copies of this email and any 
attachments thereto.





_______________________________________________

Rdkit-discuss mailing list

Rdkit-discuss@lists.sourceforge.net<mailto:Rdkit-discuss@lists.sourceforge.net>

https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to