Dear all,

Using pybel, I would like to generate a smarts with explicit H before
doing a substructure search.

Actually, I'm seeking analogs of a reference molecule - let's say HO-CH2-NH2.
I want to keep the HO-CH2 part (the "scaffold").
I delete the NH2 and generate the smarts for HO-CH2 (and I hope that
OpenBabel doesn't add spontaneously the "missing" hydrogen).
The smarts generated is "OC" if I guess well.
Then, I look for analogs matching the smarts - e.g. HO-CH2-CH3.
With my current code,it is matching CH3-O-CH3 too. Sure, it's correct...

But I want only analogs with the HO-CH2 scaffold. Is it possible to
generate the corresponding smarts with explicit hydrogens, i.e.
[H]OC([H])[H] or [OX2H1][CX4H2] ?

My current code is:


mol.OBMol.AddHydrogens() # adding H doesn't change anything

for num in smarts.findall(mol): # smarts is [H]N[H]
        atomToDel.append(mol.atoms[num-1])
for atom in atomToDel:
        mol.OBMol.DeleteAtom(atom.OBAtom)               

scaffoldSmiles = mol.write("can")
scaffoldSmarts = pybel.Smarts(scaffoldSmiles)

print len(scaffoldSmarts.findall(molAnalog))

Thanks,
Regards,
Pascal

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to