[Open Babel] OB segfault

2014-09-25 Thread Dimitri Maziuk
Hi all,

for this I'm using D-Alanine from PubChem:
https://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=71080

inchi string is copy-pasted from the page, the SDF is from "download 2D
SDF" button.

Enjoy:

> $ python
> Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
> [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
 import sys
 sys.path.append( "/share/linux/openbabel-2.3.2/lib" )
 import pybel
 import openbabel
 mol = pybel.readstring( "inchi", 
 "InChI=1S/C3H7NO2/c1-2(4)3(5)6/h2H,4H2,1H3,(H,5,6)/t2-/m1/s1" )
 mol.removeh()
 svg = mol.write( format = "svg", opt = { "b" : "none" } )
> Segmentation fault (core dumped)
> $ python
> Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
> [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
 import sys
 sys.path.append( "/share/linux/openbabel-2.3.2/lib" )
 import pybel
 import openbabel
 mol = pybel.readfile( "sdf", 
 "/share/dmaziuk/projects/metabolomics/71080.sdf" ).next()
 mol.removeh()
 svg = mol.write( format = "svg", opt = { "b" : "none" } )


-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu



signature.asc
Description: OpenPGP digital signature
--
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


[Open Babel] SVG draws unwanted extra hydrogens

2014-09-25 Thread Lee-Ping Wang
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


Re: [Open Babel] SVG draws unwanted extra hydrogens

2014-09-25 Thread Lee-Ping Wang
Sorry for the extra email; I'm attaching the original .xyz file that I am 
trying to represent in the 2D image.

- Original Message -
From: "Lee-Ping Wang" 
To: openbabel-discuss@lists.sourceforge.net
Sent: Thursday, September 25, 2014 8:34:41 PM
Subject: SVG draws unwanted extra hydrogens

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


coords.xyz
Description: Xmol XYZ data
--
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