setHCountMatching to only look at explicit hydrogens

User fa1369adab

03-02-2006 20:29:18

How can I set H count matching in a MolSearch so that only explicit hydrogens are matched, and they must match precisely? I am dealing with Lewis structures in which a missing hydrogen really means "there is no hydrogen here".

ChemAxon a3d59b832c

03-02-2006 21:35:14

Hi Raphael,





There is no such option in MolSearch, but you can play around with the different query properties. There are a few related to hydrogens:





H - total number of hydrogens


h - number of implicit hydrogens


X - total number of connections


D - number of explicit connections





http://www.chemaxon.com/jchem/doc/user/Query.html#atprop





To do this automatically, maybe the easiest is to calculate D properties from the explicit hydrogens. (Just count the number of connections per atom.) and set MolSearch.setExactQueryAtomMatching(true) for the matching.





Best regards,


Szabolcs