You can put brackets around the carbon in carbon monoxide and not get the
hydrogen. Otherwise, smiles specifies that carbon must have 4 bonds, so you
need a hydrogen to fill the fourth bond.
Note, you'll probably now have a little dot next to the carbon. I have no
idea how to get rid of that.
On Thu, Sep 25, 2014 at 11:34 PM, 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