From: Noel O'B. <bao...@gm...> - 2008-04-29 20:21:01
|
---------- Forwarded message ---------- From: Florian Nigsch <fn...@ca...> Date: 2008/4/29 Subject: pybel: Addition of hydrogens To: Noel O'Boyle <bao...@gm...> Hi Noel, And here we go with the next question: 1) I read in a molecule (sildenafil), remove the hydrogens, get a canonical smiles (CCOc1ccc(cc1c1nc(=O)c2n(C)nc(CCC)c2[nH]1)S(=O)(=O)N1CCN(C)CC1) which I keep to create the same molecule again later. 2) I read the molecule back in from the smiles with pybel.readstring() 3) I delete the hydrogens with OBMol.DeleteHydrogens() 4) I match with pybel.Smarts("[R]~[!R]") - i.e., get anything non-ring that is connected to a ring 5) print [m.atoms[x-1].OBAtom.GetType() for (y,x) in SmartsMatch] and get ['O3', 'So2', 'O2', 'C3', 'C3', 'So2', 'C3'] - which is fine. If I leave out step 3, then I find ['O3', 'So2', 'O2', 'C3', 'C3', 'H', 'So2', 'C3'] and there is suddenly a hydrogen in there. Where does it come from? Does OpenBabel add hydrogens internally when reading in from a smiles? Why does it only match one out of all possible ring-hydrogens (there are about 8 I think)? Thanks a lot, Flo |