From: Noel O'B. <bao...@gm...> - 2006-12-15 17:06:51
|
Thanks Andreas for letting us know about this problem. First of all, can you let us know whether this problem occurs if you use the babel executable itself to convert the file? (If so, the problem is nothing to do with the Python bindings) Noel On 15/12/06, Andreas Karwath <ka...@in...> wrote: > Hi all, > > I hope I don't have to send this to the developer list... > > I have installed the latest version of openbabel (2.1.0b3) including the > python bindings... (openbabel and pybel), Linux Suse 9.2 > I wanted to parse a gzipped SDF file (zipped file size 14 M) to extract > specific molecules (by name), for this I first tried to do the normal > routine, i.e.: > > sdfFileName =3D <someGzippedSDFFile> > obconversion =3D OBConversion() > obconversion.SetInFormat("sdf") > obconversion.SetOutFormat("smi") > obmol =3D OBMol() > > notatend =3D obconversion.ReadFile(obmol,sdfFileName) > export =3D obconversion.WriteFile(obmol,'myTest.smi') > while notatend: > obconversion.Write(obmol) > obmol =3D OBMol() > notatend =3D obconversion.Read(obmol) > > On a normal (i.e. unzipped) SDF File it works fine. But not on a gzipped = one > -> Segmentation Fault. It can only get access the first single molecule > > The same is true when using the new pybel lib. -> Segmentation Fault! > > I assume that OpenBabel keeps a pointer to the last read molecule in the = SDF > file, which would not work when accessing the zipped one... > > I don't want to unpack the file, as I have a few hundred of those.. (disk > space!) > > Did anyone have the same problem and knows an elegant workaround? > I guess the problem should occur for other scripting languages as well... > > Regards, > > A. Karwath > ----------------- > > Dr. Andreas Karwath > Machine Learning Lab > Institute for Computer Science > Albert-Ludwigs-Universit=E4t Freiburg > Georges-K=F6hler-Allee 079 > D-79110 Freiburg > Germany > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > > _______________________________________________ > OpenBabel-scripting mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > |