Makes sense, thank you Ivan!

Doctoral Researcher
Environmental Cheminformatics
UNIVERSITÉ DU LUXEMBOURG

Campus Belval | Luxembourg Centre for Systems Biomedicine
6, avenue du Swing, L-4367 Belvaux
T +356 46 66 44 67 18
https://adelenel.ai










________________________________
From: Ivan Tubert-Brohman <ivan.tubert-broh...@schrodinger.com>
Sent: 08 July 2021 19:02:10
To: Adelene LAI
Cc: rdkit-discuss
Subject: Re: [Rdkit-discuss] Hydrogens not recognised as Dummy Atoms?

Hi Adelene,

You can't match an atom that doesn't exist as a node in the molecular graph, so 
if you really want to match a hydrogen, you'll have to add explicit hydrogens 
to your molecule:

molh = Chem.AddHs(mol)
molh.HasSubstructMatch(q1)
> True

However, if all you want to know is whether the oxygen is next to a hydrogen, 
you can make the hydrogen count a property of the oxygen atom by using SMARTS:

q3s = 'CCOCCOCCC[OH]'
q3 = Chem.MolFromSmarts(q3s)
mol.HasSubstructMatch(q3)
> True

Hope this helps,
Ivan
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to