Re: [OpenBabel-Devel] Change to SMILES writer for hypervalent atoms

2017-03-02 Thread Andrew Dalke
On Mar 2, 2017, at 20:34, Craig James  wrote:
> Well, "FIF" violates the OpenSMILES spec in section 3.1.5, which states that 
> the "organic subset" are only allowed outside of brackets if they're in their 
> normal lowest-valence state. Actually, now that I read it, it's not well 
> written and has room for (mis)interpretation. The phrase that I think applies 
> in OpenSMILES is:

My understanding of Daylight SMILES is that when the explicit valence based on 
the bonds is higher than the maximum natural valence then the deduced hydrogen 
count is 0.

For example, quoting 
http://www.daylight.com/meetings/summerschool98/course/dave/smiles-intro.html :

> In practice, one chemist might represent nitromethane as C[N+](=O)[O-] with a 
> nitrogen of valence 3 in a charge-separated structure while another might 
> represent it as CN(=O)=O with a neutral 5-valent nitrogen. Which SMILES is 
> correct? Both are.




On Mar 2, 2017, at 20:34, Craig James  wrote:
> If you can say, "It's obvious ...", and this is a feature everyone would 
> like, then the OpenSMILES spec could be changed.

I think it should be changed.

Andrew
da...@dalkescientific.com



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] Bzip2 format support

2013-01-17 Thread Andrew Dalke
On Jan 17, 2013, at 6:20 PM, Kirill Okhotnikov wrote:
 I decided to implement bzip2 pack/unpack functionality in open-babel 
 (#91 bzip2 compression/decompression).

What does the #91 mean? It's not the Open Babel bug id, and a search
of the mailing list finds nothing matching bzip or bzip2.

I do not think bzip2 support is important. I have rarely come across
people using it for cheminformatics data. For example, while PubChem,
ChEMBL and others release their data sets with gzip compression, I
don't know of anyone who releases bzip2 files.

Which data sets do you use which are big enough that the better
bzip2 compression becomes worthwhile?

As you found out, bzip2 doesn't support random seeking. It *can*
be emulated, which Python's bz2 module does, but depending on
the parameters the operation may be extremely slow.


Personally, I think bzip is no longer a useful format. If you're
willing to take the extra CPU time then use the LZMA-based methods,
like .xz. Here's how the Python source distribution compresses
with each of the three methods:

• Gzipped source tar ball ~ 16 MB
• Bzipped source tar ball ~ 14 MB
• XZ compressed source tar ball ~ 11 MB


I also think that supporting Boost is a nuisance. However, if
only some Boost functionality is needed, why not just include its
header files?


 I think, that it will be good idea to have boost library to be required by 
 the project (connected permanently). Some other boost libraries can be 
 useful. For example, Program Options, Geometry, RegExp. In the future 
 developers can easily use this powerful well known library.

Developers can already use Boost, by installing it themselves.

The only reason for switching to Boost is if Open Babel would make
effective use of what Boost provides. But the examples you list aren't
things which would easily change:

  - who would rewrite the options parser to use the Boost one?

  - why replace the existing geometry code with an alternative?

  - what advantages does RegExp have over C++'s regex? (I see
   that src/formats/gamessukformat.cpp already uses that
   the regex library that the C++ compiler provides.)

  - how much code would break?

Now, there are answers to this. For example, perhaps the Boost
geometry code makes parts of Open Babel 3x faster, or perhaps
20 of the format parsers could be shortened by 90% while being
more maintainable. But given the known work in rewriting those
parts of the code, and the known difficulty of supporting
Boost - something I've experienced myself - it's not as easy as
saying that other people might find it useful.

 3) Can somebody help me to compile and test the system under MS Windows?

If all else fails, you might look into using an Amazon instance
running MS Windows, then install Visual Studio Express to compile
C++ code from the command-line.

Cheers,

Andrew
da...@dalkescientific.com



--
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] Fragmentation

2011-01-25 Thread Andrew Dalke
On Dec 21, 2010, at 10:55 PM, erapp wrote:
 I need to be able
 to find all unique fragments for a molecule of a given length (i.e. number
 of atoms in fragment) and provide information about what makes it unique.

You might be able to adapt some code I wrote a few weeks ago, at

http://www.dalkescientific.com/writings/diary/archive/2011/01/13/faster_subgraph_enumeration.html

It's for OEChem but the translation to OpenBabel wouldn't be that hard. Craig 
James wrote:

 If you do find an algorithm that produces a reasonable number of fragments, 
 the canonical SMILES generator might be useful.  It has the ability to 
 generate fragment SMILES.  


and if you rewrite the subgraph-to-SMARTS code using that, you might get better 
performance than OEChem, which doesn't have that feature.


As Craig pointed out, the number of subgraphs grows quickly as a function of 
the number of atoms in the subgraph. I've found that k=6 and k=7 are tractable, 
but I haven't yet explored larger sizes to judge what the distribution looks 
like for typical small molecules.


Andrew
da...@dalkescientific.com



--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] [Open Babel] Python test cases (Moving to OpenBabel-dev)

2010-11-11 Thread Andrew Dalke
On Nov 11, 2010, at 9:58 PM, Noel O'Boyle replied to Andrew Dalke:
 Since I'm not (directly) calling WriteMolecule and since my
 test cases don't support the --gen2D or --gen3d flags, this
 warning isn't that helpful in a library function.
 
 This is by design (added recently). Up until recently, new users
 thought that Open Babel didn't work, and complained to the mailing
 list. I remember it confused me too when I first did a SMILES to SDF
 conversion and it came up all zeros! This way we annoy you and me but
 everyone else is happy.

I understand the need for the warning. It's useful and appropriate.

But in a general-purpose library, this warning is less useful
and rarely appropriate. It indicates that the library should have
some way to flag to the caller that some action should be done,
and let the caller figure out the right way to handle that.

For example, in a GUI without a console, that message isn't
helpful.

However, as the number of people who have a problem with this
are very small in number, I am not suggesting a change to the
API. I wanted to point this out only if there was a simple
solution which addressed everyone's problems.

 3) Why does the fingerprint GetBit require a fingerprinter instance?
 That is, I have to go through a bound method
 
x = ob.OBFingerprint.FindFingerprint(FP2)
self.assertEquals(x.GetBit(v, 0), True)
 
 instead of using a static/global function
 
self.assertEquals(ob.OBFingerprint.GetBit(v, 0), True)
 
 ?

That is, why do I need the FP2 or to load any fingerprinter.
Is there any way to call GetBit otherwise?

 All Begin/End methods do not work from Python. Many of them are
 disabled from Python.

Okay. Didn't know that.

 6) I included tests for iterating over atoms and bonds in
 a molecule, and for atoms and bonds connected to an atom. I
 expected I could also iterate over the atoms in a bond, but
 there is no OBBondAtomIter . While not important, it appeals
 to my sense of symmetry and it's very simple to write.
 
 True, but will have to wait until next API change.

What does API change mean here? This is part of the adapter
layer to make Python work with OpenBabel. ... Ahh, you mean
that the C++ layer doesn't have an iterator interface for
this case, so the Python one won't have something like

def OBBondAtomIter(bond):
  yield bond.GetBeginAtom()
  yield bond.GetEndAtom()

until the C++ one does. Well, I can understand the reasoning
behind keeping things in synch.


 
 7) Why can't I do mol.AddBond(C, N, 3) where C and N are atoms?
 Instead, I need to do mol.AddBond(C.GetIdx(), N.GetIdx(), 3)
 
 No reason I guess. Could cause problems where C and N are not members
 of the molecule though.

Which lead me to wonder why

 import openbabel as ob
 mol = ob.OBMol()
 mol.AddBond(123,435, 3)
True

returned True. Then digging through the code I discovered
OBGenericDataType::VirtualBondData.

which lead me to try

 mol.AddBond(-123, -532, 3)
True

I don't intend for the code to change, only pointing out
something I thought was interesting.

 9) How does OpenBabel define implicit hydrogen?

 ?

Take away the other things I said. It was my attempt at
figuring out what OB does. I think I know the answer but
it's different from RDKit, OEChem, and Daylight, and
not what I'm used to, so I'm looking for enlightenment.

 I think no C arrays are accessible (I think most instances can be
 worked around). You need to use atom.GetVector().

Through the magic of ctypes. I use it in my fingerprint
reader, for example, to get faster access to the actual
fingerprint data.

 15) In an OBRing, if there are multiple non-C atoms, which one
 is the root? And since ring.GetRootAtom() returns an integer,
 shouldn't it be named GetRootAtomIdx()?
 
 ?

What does the ? refer to? There are two parts here.

  - the root

mol = parse_smiles(C12CNCC3C1.C2CCC3)
sssr = mol.GetSSSR()
ring = sssr[0]
idx = ring.GetRootAtom()

The documentation for GetRootAtom:

the index for the root atom. O for furan, S for thiazole,
N for pyrrole. For 6 membered aromatic rings, the first
non carbon atom is used for root. For 5 members rings the
O, S or N (BOSum=3, valence=3) will be used for root

That isn't enough information to figure out what it does.
What is first? What if there are multiple non-carbons, as in
C1CCOCOCCNC1 -- which is first?

   - GetRootAtomIdx()

The other API calls which end *Atom() return an OBAtom,
while *Idx() returns an integer. This is an API call which
returns an integer index instead of an actual atom.

 19) I see that MMFF94's ValidateGradients() dumps output
 to stdout. The other ValidateGradients I tested (gaff and
 ghemical) do not do that, and the output probably isn't
 appropriate for a library.
 
 Then again, the API docs say that it's meant for debugging.
 Should the debugging API be published for general use?
 
 ?

Who is the target audience for ValidateGradients()? Is
it used for anything other than

Re: [OpenBabel-Devel] possible trojan ?

2010-09-30 Thread Andrew Dalke
On Sep 30, 2010, at 2:34 PM, TJ O'Donnell wrote:
 I just got an alert from SUPERAntiSpyware that Trojan Downloader-gen/A is in
 E:\My Documents\openbabel\openbabel-2.2.3\build\CMakeFiles\CompilerIdC\a.exe
 on my computer.

http://www.processlibrary.com/directory/files/a/ says
 a.exe is registered as the w32.ahle...@mm worm which is transmitted
 via e-mail and attempts to install itself on your computer. 


TJ:
 Maybe the issue is with mingw/msys?


Looks like a.exe is the mingw equivalent of a.out
http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite
 default executable name is a.exe for all compilations. If you want
 something else, you must say so explicitly, by using the -o exename option




Andrew
da...@dalkescientific.com



--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] Silicos: Spectrophores ported under OB

2010-07-06 Thread Andrew Dalke
On Jul 6, 2010, at 11:58 AM, Geoffrey Hutchison wrote:
 I have some general concerns about using GPLv2 or later with the Silicos 
 code right now, since it is currently covered by an expiring patent. I 
 suspect this would be an easy change once the patent expires next year.

I see your point. I think the right interpretation is to say that if there's a 
conflict between the patent grant from Silicos and the choice to use GPLv3 then 
that part of the code cannot be used under the v3 license.

Here's the GNU FAQ on that topic:

http://www.gnu.org/licenses/gpl-faq.html#v2OrLaterPatentLicense

Q: My company owns a lot of patents. Over the years we've contributed code to
Q: projects under “GPL version 2 or any later version”, and the project itself
Q: has been distributed under the same terms. If a user decides to take the
Q: project's code (incorporating my contributions) under GPLv3, does that mean
Q: I've automatically granted GPLv3's explicit patent license to that user?

  No. When you convey GPLed software, you must follow the terms and conditions
  of one particular version of the license. When you do so, that version
  defines the obligations you have. If users may also elect to use later
  versions of the GPL, that's merely an additional permission they have—it does
  not require you to fulfill the terms of the later version of the GPL as well.

  Do not take this to mean that you can threaten the community with your
  patents. In many countries, distributing software under GPLv2 provides
  recipients with an implicit patent license to exercise their rights under
  the GPL. Even if it didn't, anyone considering enforcing their patents
  aggressively is an enemy of the community, and we will defend ourselves
  against such an attack.


 Incidentally, I will be relicensing *my* contributions to Open Babel under 
 BSD shortly.

I'm pleased to hear that. Or in internet-speak ... yay!

Andrew
da...@dalkescientific.com



--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] Silicos: Spectrophores ported under OB

2010-07-05 Thread Andrew Dalke
Hello, and thanks for your contribution to OpenBabel and to free software in 
general.

On Jul 1, 2010, at 3:12 AM, Hans De Winter wrote:

 We plan to do this by including a modified header in the .h and .cpp files of 
 the Spectrophore code. A proposal for this is given here:
  ...
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation version 2 of the License.

If the software is based on work done by Silicos and is not directly
derived from OpenBabel then I urge you to use the following phrase from
the GPLv2:


   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License
   as published by the Free Software Foundation; either version 2
   of the License, or (at your option) any later version.


OpenBabel is based on OpenEye's OELib, and OpenEye specified version 2 only,
without the option to use later versions of the GPL.

When OpenEye released under that license, it wasn't a problem as there was
no later license. But GPLv3 was released several years ago, and I expect
problems in the future as more and more people start using the v3 license
over the v2.

It expect it will take about a decade to be a serious problem, but there's
no reason that new contributions can't using a or any later version,
which would help reduce the severity of future problems.

It also means that someone could take your contribution and make it work
with, under Indigo, which is a relatively recent cheminformatics code
released under GPLv3.

Best regards,

Andrew Dalke
da...@dalkescientific.com



--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] segfault on Mac

2010-04-12 Thread Andrew Dalke
On Apr 12, 2010, at 3:04 AM, Geoffrey Hutchison wrote:
 I'd highly suggest using SVN trunk. 

Ummm, how?

It looks like the configure-based installation has been removed.

% svn co 
https://openbabel.svn.sourceforge.net/svnroot/openbabel/openbabel/trunk ob-trunk
% cd ob-trunk/
% find . -name '*config*'
./src/.svn/text-base/config.h.cmake.svn-base
./src/config.h.cmake
./windows-vc2005/.svn/prop-base/babelconfig.h.svn-base
./windows-vc2005/.svn/text-base/babelconfig.h.svn-base
./windows-vc2005/babelconfig.h
%
% head INSTALL 
Basic Installation
==

   These are generic installation instructions.

   The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation.  It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions.  Finally, it creates a shell script `config.status' that
%




The page at http://openbabel.org/wiki/Subversion
  (Get latest development code)
says
  (2) Configure and compile this in the usual way, as described
  on the Install (source code) page

but that wants a ./configure as well.

Confusedly yours,


Andrew
da...@dalkescientific.com



--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] segfault on Mac

2010-04-12 Thread Andrew Dalke
On Apr 12, 2010, at 9:51 AM, Noel O'Boyle wrote:
 There's a memory leak in readstring, at least when used with SMILES
 string, even with trunk. There is a filed bug -
 http://sourceforge.net/tracker/?func=detailaid=2978796group_id=40728atid=428740.

I didn't think that was the problem because I didn't notice any
real growth when I was looking earlier. I see it now though. (One
issue is that the code caches 100,000 structures, which means leaks
are somewhat hidden.)

PIDCOMMAND  %CPU TIME #TH  #WQ  #POR #MREG RPRVT  RSHRD  RSIZE
5302  Python   93.1 00:46.35 1/1  019   415   88M+   1384K  93M+
 ... wait a while ...
5302  Python   90.1 01:58.91 1/1  019   418   92M1384K  97M 
 ... wait a while more ...
75302  Python   93.5 03:34.32 1/1  019   424   98M1384K  103M 
  ...
75302  Python   92.7 06:38.67 1/1  019   426   100M+  1384K  105M+

I then ran your reproducible from that bug report

#include openbabel/mol.h
#include openbabel/obconversion.h

using namespace OpenBabel;
int main() 
{
OBMol mol;
OBConversion conv;
conv.SetInFormat(smi);
for (int i=0; i100; ++i)
conv.ReadString(mol, b...@h](I)F);
return 0;
}

g++ -I/usr/local/include/openbabel-2.0 nob.cpp -L/usr/local/lib -lopenbabel

./a.out

and there was a definite leak in that code.


75261  a.out92.1 00:02.45 1/1  014   284+  1952K+ 240K-  4844K+
75261  a.out92.9 00:15.92 1/1  014   290+  8224K+ 240K   11M+
75261  a.out92.4 01:01.23 1/1  014   310   29M+   240K   31M+


However, a memory leak by itself doesn't explain the segfaults.
I never get close to running out of memory.


Andrew
da...@dalkescientific.com


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel


Re: [OpenBabel-Devel] segfault on Mac

2010-04-12 Thread Andrew Dalke
On Apr 12, 2010, at 3:04 AM, Geoffrey Hutchison wrote:
 You don't mention what version of OB you're using, but imply it's not the 
 latest development code. I'd highly suggest using SVN trunk.

That fails to work, in a much worse way than before.

After working with Noel to update the build instructions for
working out of SVN, and upgrading my copy of SWIG to 1.3.40 
I got everything built and installed. It doesn't work though.
Here's my test case.

[xavier:~/ftps/openchord] dalke% cat strange.py 
import openbabel
obc = openbabel.OBConversion()
obc.SetInFormat(smi)
mol = openbabel.OBMol()
obc.ReadString(mol, c1c1O)
print Done.

It crashes in ReadString, which I did by hand.

[xavier:~/ftps/openchord] dalke% python strange.py 
Segmentation fault


[xavier:~/ftps/openchord] dalke% gdb `which python`
GNU gdb 6.3.50-20050815 (Apple version gdb-1346) (Fri Sep 18 20:40:51 UTC 2009)
 ... lines omitted ...
(gdb) run strange.py
Starting program: /usr/bin/python strange.py
Reading symbols for shared libraries .++. done

Program received signal SIGTRAP, Trace/breakpoint trap.
0x7fff5fc01028 in __dyld__dyld_start ()
(gdb) cont
Continuing.
Reading symbols for shared libraries . done
Reading symbols for shared libraries .. done
Reading symbols for shared libraries ... done
Reading symbols for shared libraries . done
  ... many lines omitted ...
Reading symbols for shared libraries . done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0090
OpenBabel::SMIBaseFormat::ReadMolecule (this=value temporarily unavailable, 
due to optimizations, pOb=value temporarily unavailable, due to 
optimizations, pConv=0x1002791a0) at 
/Users/dalke/cvses/ob-trunk/src/formats/smilesformat.cpp:282
282 pmol-SetDimension(0);

To show some context

(gdb) l
277   obErrorLog.ThrowError(__FUNCTION__, 
278 smiles +  contained a character ' + smiles[pos] + ' which is 
invalid in SMILES, obError);
279   return false;
280 }
281 
282 pmol-SetDimension(0);
283 OBSmilesParser sp;
284 
285 pos = smiles.find('');
286 if(pos==string::npos)


and it's a straight NULL pointer deference.

(gdb) print pmol
$1 = (class OpenBabel::OBMol *) 0x0


The call stack.

(gdb) where
#0  OpenBabel::SMIBaseFormat::ReadMolecule (this=value temporarily 
unavailable, due to optimizations, pOb=value temporarily unavailable, due to 
optimizations, pConv=0x1002791a0) at 
/Users/dalke/cvses/ob-trunk/src/formats/smilesformat.cpp:282
#1  0x00010146b8bc in OpenBabel::OBConversion::Read (this=0x1002791a0, 
pOb=0x100293b70, pin=value temporarily unavailable, due to optimizations) at 
/Users/dalke/cvses/ob-trunk/src/obconversion.cpp:747
#2  0x00010147083c in OpenBabel::OBConversion::ReadString 
(this=0x1002791a0, pOb=0x100293b70, input=value temporarily unavailable, due 
to optimizations) at /Users/dalke/cvses/ob-trunk/src/obconversion.cpp:895
#3  0x000101155444 in _wrap_OBConversion_ReadString (args=value 
temporarily unavailable, due to optimizations) at openbabel-python.cpp:17379
#4  0x0001aff3 in PyObject_Call ()
#5  0x00010008a51a in PyEval_EvalFrameEx ()
#6  0x00010008acce in PyEval_EvalCodeEx ()
#7  0x00010008ad61 in PyEval_EvalCode ()
#8  0x0001000a265a in Py_CompileString ()
#9  0x0001000a2723 in PyRun_FileExFlags ()
#10 0x0001000a423d in PyRun_SimpleFileExFlags ()
#11 0x0001000b0286 in Py_Main ()
#12 0x00010e6c in ?? ()


BTW, is there a way to get the version number from OpenBabel?
In trying to get this all working I ran into snags where I was
installed into the wrong directory, and I couldn't figure out
a way to tell if the import openbabel I just installed was
the right one, except by looking at the file timestamp.

Ideally I would like to have a way to get the pybel.py,
openbabel.py, and underlying shared library versions.

To make sure I have the right extension modules (I
wondered if I had a version mismatch), I include part
of what Apple's crash reporter says:


  0x101816000 -0x101a3 +libopenbabel.4.dylib 4.0.0 
(compatibility 4.0.0) A1B64057-4A8A-520C-AD96-4227D6B58DF5 
/usr/local/lib/libopenbabel.4.dylib

  0x1021ca000 -0x1021e6ff7 +smilesformat.so ??? (???) 
7D01F338-7571-62B5-A8EE-53A1C2C62773 
/usr/local/lib/openbabel/2.2.99/smilesformat.so


and some file stamps

-rwxr-xr-x  1 root  wheel  3281376 Apr 12 20:19 
/usr/local/lib/libopenbabel.4.0.0.dylib
lrwxr-xr-x  1 root  wheel   24 Apr 12 15:22 
/usr/local/lib/libopenbabel.4.dylib - libopenbabel.4.0.0.dylib

-rwxr-xr-x  1 root  wheel  211456 Apr 12 20:19 
/usr/local/lib/openbabel/2.2.99/smilesformat.so


You can see I do have the right shared library here.



Andrew
da...@dalkescientific.com



--
Download Intel#174; 

Re: [OpenBabel-Devel] segfault on Mac

2010-04-12 Thread Andrew Dalke
On Apr 12, 2010, at 9:01 PM, Noel O'Boyle wrote:
 SetInFormat should return true for success. Does it?

 import openbabel
 obc = openbabel.OBConversion()
 obc.SetInFormat(smi)
True
 mol = openbabel.OBMol()
 mol
openbabel.OBMol; proxy of Swig Object of type 'OpenBabel::OBMol *' at 
0x1004e5e40 
 mol.NumAtoms()
0
 obc.ReadString(mol, c1c1O)
Segmentation fault


I can work with molecules directly


 import openbabel
 mol = openbabel.OBMol()
 mol.NewAtom(6)
openbabel.OBAtom; proxy of Swig Object of type 'OpenBabel::OBAtom *' at 
0x1004e5e10 
 mol.NumAtoms()
1
 

 obc = openbabel.OBConversion()
 obc.SetOutFormat(smi)
True
 obc.WriteString(mol)
Segmentation fault

and for the curious, here's the most relevant part of the stack trace


Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   smilesformat.so 0x000102206cf7 
OpenBabel::SMIBaseFormat::WriteMolecule(OpenBabel::OBBase*, 
OpenBabel::OBConversion*) + 215 (mol.h:267)
1   libopenbabel.4.dylib0x00010146c04a 
OpenBabel::OBConversion::Write(OpenBabel::OBBase*, std::ostream*) + 554 
(obconversion.cpp:811)
2   libopenbabel.4.dylib0x00010146c199 
OpenBabel::OBConversion::WriteString(OpenBabel::OBBase*, bool) + 121 
(obconversion.cpp:836)
3   _openbabel.so   0x00010114b656 
_wrap_OBConversion_WriteString + 590 (basic_string.h:501)
4   org.python.python   0x0001aff3 PyObject_Call + 112


I get the same Segmentation fault with sdf, although with a different stack 
trace, as expected:

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   mdlformat.so0x000102044de4 
OpenBabel::MDLFormat::WriteMolecule(OpenBabel::OBBase*, 
OpenBabel::OBConversion*) + 116 (mdlformat.cpp:604)
1   mdlformat.so0x00010204eae1 
OpenBabel::SDFormat::WriteMolecule(OpenBabel::OBBase*, 
OpenBabel::OBConversion*) + 65 (mdlformat.cpp:146)
2   libopenbabel.4.dylib0x00010146c04a 
OpenBabel::OBConversion::Write(OpenBabel::OBBase*, std::ostream*) + 554 
(obconversion.cpp:811)
3   libopenbabel.4.dylib0x00010146c199 
OpenBabel::OBConversion::WriteString(OpenBabel::OBBase*, bool) + 121 
(obconversion.cpp:836)





Andrew
da...@dalkescientific.com



--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel