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