Dear all,
Thanks for your answers!
I have no objection to Chris' code modification proposal.
With Craig's suggestion and Noel's blog (so useful for code
inspiration (plagiarism...) - at least for me :), I got this working
with pybel:
conv = ob.OBConversion()
conv.SetInAndOutFormats("smi", "can")
conv.SetOptions("h", conv.OUTOPTIONS)
for mol in pybel.readfile("smi", "file.smi"):
mol.OBMol.AddHydrogens()
smiles = conv.WriteString(mol.OBMol)
print smiles
Output is e.g.;
[CH3][CH2]N([CH3])C(=O)N([CH3])c1[cH][cH][cH][cH][cH]1 mol1
[NH2]C(=O)N([CH3])c1[cH][cH][cH][cH]c1[OH] mol2
I'll try to place this in my program and see the behaviour with the
atom deletions.
I keep Andrew's proposal in mind anyway :)
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss