[Open Babel] Possible bug source... smiles mol2 conversion

2010-10-21 Thread JP
Hi there,

A colleague of mine and myself noticed this 'interesting' behaviour earlier
on today - and I thought I'd drop you an email to get your feedback on this.

A simple test - using Open Babel 2.2.3 -- Sep 15 2010 -- 15:57:55

Put this line in co2h.smi:
(=O)(O)

Then run:

babel co2h.smi co2h.mol2
babel co2h.mol2 co2h-broken.smi

You can also do (for comparison):

babel co2h.smi co2h.sdf
babel co2h.sdf co2h-not-broken.smi

You will notice that co2h-not-broken.smi has the correct double bond (=)
while co2h-broken.smi does not.

Cheers and thanks,
JP
--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] [OpenBabel-Devel] Version 2.3.0 Release Candidate 1

2010-10-21 Thread Tim Vandermeersch
On Thu, Oct 21, 2010 at 1:35 AM, Tim Vandermeersch
 wrote:
> On Wed, Oct 20, 2010 at 4:29 PM, Igor Filippov [Contr]
>  wrote:
>> Tim,
>>
>>> I'll take a look since it is an important format to support. This
>>> should be the last major issue for static building though.
>>>
>>
>> Great - thank you! Could the static_plugins.o be also compiled into
>> libopenbabel.a by default? I think this would make sense...
>
> Yes, but this would require the -u flags again... The plugins are
> compiled into libopenbabel.a but the symbols are not taken from the
> libopenbabel.a archive when linking your executable since they are not
> referenced. There are two solutions:
>
> * Include the plugins inside the executable (or include
> static_plugin.o when linking)
> * Undefine the symbols explicitly at link time using the -u flag to
> ensure the symbols are taken from libopenbabel.a
>
> However, I just pushed the changes to include inchi in the static
> builds and you could use this command line to create a
> static_plugins.o that contains all plugins: (run this after compiling)
>
> tim...@timvdm-desktop:~/openbabel-gitsvn/build_static$ g++ -Wl,-r -o
> static_plugins.o -nostdlib  src/CMakeFiles/openbabel.dir/charges/*.o
> src/CMakeFiles/openbabel.dir/descriptors/*.o
> src/CMakeFiles/openbabel.dir/fingerprints/*.o
> src/CMakeFiles/openbabel.dir/forcefields/*.o
> src/CMakeFiles/openbabel.dir/formats/*.o
> src/CMakeFiles/openbabel.dir/formats/xml/*.o
> src/CMakeFiles/openbabel.dir/ops/*.o
>
> tim...@timvdm-desktop:~/openbabel-gitsvn/build_static$ ls static_plugins.o -lh
> -rw-r--r-- 1 timvdm timvdm 65M 2010-10-21 01:16 static_plugins.o
>
> tim...@timvdm-desktop:~/openbabel-gitsvn/build_static$ objdump -t
> static_plugins.o | grep _ZTVN9OpenBabel11InChIFormatE
>  l    d
> .rodata._ZTVN9OpenBabel11InChIFormatE   
> .rodata._ZTVN9OpenBabel11InChIFormatE
>   w    O
> .rodata._ZTVN9OpenBabel11InChIFormatE   00a8 .hidden
> _ZTVN9OpenBabel11InChIFormatE
>
> tim...@timvdm-desktop:~/openbabel-gitsvn/build_static$ g++ -Iinclude
> -I../include -static  ../doc/examples/static_executable/myexe.cpp
> static_plugins.o -o myexe  src/libopenbabel.a
> src/formats/inchi103/libinchi.a -Wl,-Bstatic -lxml2 -lz
> ...
> tim...@timvdm-desktop:~/openbabel-gitsvn/build_static$ ./myexe
> ... lists all plugins ...
>
> The command first line "merges" all the object files in a single
> static_plugins.o. There is probably a better way but at least you
> should now be able to make a static executable with all plugins.

With r4240, plugins are now included in an executable without any
additional hacks. It's all done in C++ which means it is also easier
to maintain for different compilers. This also means that the tests
can now be executed for static builds. This helped me identify some
missing plugins.

Tim

> Tim
>
>> Igor
>>
>>
>

--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Possible bug source... smiles mol2 conversion

2010-10-21 Thread Geoffrey Hutchison

On Oct 21, 2010, at 12:13 PM, JP wrote:

> A colleague of mine and myself noticed this 'interesting' behaviour earlier 
> on today - and I thought I'd drop you an email to get your feedback on this.

Mol2 has this strange feature that carboxylates are evidently supposed to be 
marked with "aromatic" bonds.

Once I saw your post, I knew the problem -- the ReadMolecule() code for mol2 
doesn't make any attempt to clean up the carboxylates before they are handed 
off to the aromatic detection and Kekule assignment code.

This is now fixed in trunk, and will be part of 2.3.0.

Thanks!
-Geoff


--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss