The H atoms are drawn intentionally. See the docs for the 'a' option: a draw all carbon atoms So propane would display as H3C-CH2-CH3
What you want is an additional option that draws the C's but not the H's. I don't have time now to do development, but it should be pretty easy to see where option 'a' is in the C++ code and add a new option to do as you suggest. Perhaps you, or someone else reading this, would like to try this. - Noel On 26 September 2014 04:34, Lee-Ping Wang <leep...@stanford.edu> wrote: > 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 > > ------------------------------------------------------------------------------ > 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 > ------------------------------------------------------------------------------ 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