Hi,
I was writing an application in python which reads and writes some data
stored in gzipped sdf and mol2 files. These files are gzipped, and I can use
them directly with pybel.readfile in linux without problems with OB 2.3.
However, when I try the same on MS Windows with OB 2.3 and python 2.7.1,
when I try to read a sdf file I just get a warning like this:

-------------
>>> mols = pybel.readfile('sdf','test_file.sdf.gz')
>>> mols.next().title()
==============================
*** Open Babel Warning  in OpenBabel::MDLFormat::ReadMolecule
  WARNING: Problems reading a MDL file
Missing data following atom specification in atom block

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
StopIteration
>>>
--------------------

With other formats (such as mol2) I don't even get a warning; it just
silently fails and returns an empty iterator:

--------------------
>>> mols = pybel.readfile('mol2','test_file.mol2.gz')
>>> mols.next().title()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
StopIteration
>>>
----------------------

Is this behaviour a known bug or limitation or am I doing something wrong?
I've tested it in windows XP, Windows 7 and even on wine, always with latest
packages of OB, python and OB python bindings, and is always reproducible.

Thanks in advance,

Adrià Cereto-Massagué

-- 
*Adrià Cereto Massagué*
Biotechnology student
Universitat Rovira i Virgili

Languages: Català, Español, English, Français, Deutsch, Português, Esperanto

Nota importante
<http://www.gnu.org/philosophy/no-word-attachments.es.html>| Important
Notice <http://www.gnu.org/philosophy/no-word-attachments.html>
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
OpenBabel-scripting mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-scripting

Reply via email to