New Bonds / Hydrogens

I think there is a bug in the way that Bonds are getting added. Like,
we need to do AddBond instead of CreateBond or something like this. I
will check into it more but it probably relates to the problem you were
having with double bonds. I am attempting to add hydrogens and i
believe that a lot of the problems i’m having are related to problematic
optimization code in OpenBabel.

For instance, someone has introduced a flag which toggles whether the
hydrogens have been added already or not. This is OK as long as it gets
unset everytime a atom is added / removed or when a hydrogen is
added/removed. This was not the case and i did end up adding a few of
them which is now in OB trunk. I am pushing the plugin code i have
changed so far but it needs improvements.

-Donald

On Feb 18, 2007, at 8:58 PM, Donald Ephraim Curtis wrote:

having with double bonds. I am attempting to add hydrogens and i
believe that a lot of the problems i’m having are related to
problematic
optimization code in OpenBabel.

OK, let’s see if we can get some test cases for Open Babel. If you
can point me to specific OB calls which seem to be trouble, let me
know and I’ll try out a unit test. (Then we can create a bug report,
get the thing fixed, and solve it for all of us.)

unset everytime a atom is added / removed or when a hydrogen is
added/removed. This was not the case and i did end up adding a few of
them which is now in OB trunk.

For example, could you file a bug report for this? Particularly as we
get close to a release, I find it really helpful to have checklists:
what’s done, what needs to get fixed, etc.

Thanks,
-Geoff

P.S. Do you still want me to cook up a Mac package? Cmake is still
difficult to create a Mac.app “bundle” with drag-and-drop, so I may
use some scripts on the web.

On Feb 18, 2007, at 8:58 PM, Donald Ephraim Curtis wrote:

having with double bonds. I am attempting to add hydrogens and i
believe that a lot of the problems i’m having are related to
problematic
optimization code in OpenBabel.

OK, let’s see if we can get some test cases for Open Babel. If you
can point me to specific OB calls which seem to be trouble, let me
know and I’ll try out a unit test. (Then we can create a bug report,
get the thing fixed, and solve it for all of us.)

In the openbabel test dir you can now find addhydrogens.cpp. This new unit
test creates a molecule from smiles “CC”, adds hydrogens, deletes them, adds
another C atom and add hydrogens again. This last step seems to be the
problem. The OBMol::_nbonds is correctly updated, but when you try a
FOR_BONDS_OF_MOL loop, there is one bond missing…

Tim