Hi Noel. Thanks for the ideas. I have been able to increase the size of molecules by editing make3D(). I make the addh() line optional. The force field optimization still works without hydrogen atoms. I then later addh(). This makes larger molecules accessible; it still has a limit, and I am in the process of exploring that limit.
I will look into using obabel from a command line and its gen3d() argument. Thanks. Steve Steven G. Arturo 7B/207P 979.238.5749 -----Original Message----- From: Noel O'Boyle [mailto:[email protected]] Sent: Tuesday, November 15, 2011 5:40 AM To: Arturo, Steven (SG) Cc: [email protected] Subject: Re: [OpenBabel-scripting] more graceful exit for make3D on large molecules Hi Steven, It ran out of memory setting up the VdW part of the forcefield optimisation. The resulting segfault is handled gracefully in C++ (raising a C++ exception) but currently this doesn't cross the boundary to Python very well except to cause trouble. The only way around this would either be to move to a 64-bit setup (which is a bit untested for Windows) but is working for Adrià on Linux. Or to call obabel at the command-line from Python to read and write from a file. If, for your purposes, you don't need to run the forcefield, then of course you could edit the code in "make3D()" not to run the forcefield optimisation. You would still have some sort of a 3D structure. - Noel On 14 November 2011 20:58, Arturo, Steven (SG) <[email protected]> wrote: > Good day all. I understand that I use pybel to manipulate structures > that are larger than what the code is intended to do. So I am testing > the limits of this. > > > > I write because if I execute a 'make3D' function on a molecule that is > too large, pybel (or openbabel) crashes python. > > > > Here is what a good execution looks like when I use 'make3D' on a > large molecule. > > > > Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit > (Intel)] on > win32 > > Type "help", "copyright", "credits" or "license" for more information. > >>>> import pybel > >>>> smiles='O'+'CCO'*300 > >>>> mol=pybel.readstring('smi',smiles) > >>>> mol.make3D() > >>>> ^Z > > > > And here is what a bad execution looks like > > > > Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit > (Intel)] on > win32 > > Type "help", "copyright", "credits" or "license" for more information. > >>>> import pybel > >>>> smiles='O'+'CCO'*400 > >>>> mol=pybel.readstring('smi',smiles) > >>>> mol.make3D() > > > > This application has requested the Runtime to terminate it in an > unusual way. > > Please contact the application's support team for more information. > > > > As you can see, I am running a 32-bit version of python on Windows. > It is a 64-bit version of Windows 7 with 12 GB of memory. > > > > I investigated whether the error is memory-based. It seems that this > error is shown when python asks for about 490 MB of memory. This is > well below the limits of this machine, since I have run scripts on > this same machine that fail when it is ~1.7 GB of memory, something > more meaningful when I run a 32-bit application on Windows 7. > > > > Two questions... Why is this happening? And is there a more graceful > way to fail, so that I can wrap the command with a try loop and > execute the rest of my script if 'make3D' fails? > > > > Thanks for your help. > > > > Steve > > > > Steven G. Arturo > > Core R&D - E&PS > > The Dow Chemical Company > > 727 Norristown Road > > Spring House, PA 19477 > > 7B/207P 979.238.5749 > > > > ---------------------------------------------------------------------- > -------- > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > OpenBabel-scripting mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ OpenBabel-scripting mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbabel-scripting
