Hi there,
I'm using the Python interface to OpenBabel to create 2D representations of my
molecules. I'm having a great time except when it decides to draw extra
hydrogens. I'm quite sure these hydrogens are not supposed to be drawn. In
the attached image, the "CH" on carbon monoxide is not numbered; I think this
means it's not explicitly represented in the OBMol object, but the SVG writer
decides to draw it anyway. In the SVG file, the text comes out as "CH" in a
single element.
I've tried almost all combinations of add/delete, implicit/explicit hydrogens
in the input and output options. If I set {"C":True} in write(), it won't draw
the "CH" on carbon monoxide - in fact it doesn't draw any atoms to the right of
the triple bond, but I do want it to draw "C". I could just edit the .svg file
manually, but that's probably not the best solution.
Generally speaking, all I want is for OpenBabel to draw exactly the same atoms
that I gave it! :)
In [1]: import pybel
In [2]: mol = pybel.readfile('can', 'can.txt', opt={"h":True})
In [3]: mol.next().write("svg", "can.svg", opt={"a":True,"P":600,"i":True},
overwrite=True)
Thanks,
- Lee-Ping
[OH][CH]=O.C#[O].[CH2]=O.[NH2][NH2]
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss