#897 reading mol2 breaks aromaticity in 1,5,6,7-Tetrahydro-4-indolone

2.3.x
pending
None
1
2015-02-28
2013-10-09
cowsandmilk
No

$ ./bin/obabel -:"O=C1CCCc2c1cc[nH]2" -O test_can.mol2
$ ./bin/obabel test_can.mol2 -ocan
O=C1CCC[C@H]2[C@@H]1CC[NH2+]2 *

Expected result is that canonical smiles should be the same as the input canonical smiles. I've attached the intermediate mol2 file to the bug.

This works with sdf:
$ ./bin/obabel -:"O=C1CCCc2c1cc[nH]2" -O test_can.sdf
$ ./bin/obabel test_can.sdf -ocan
O=C1CCCc2c1cc[nH]2

Note, the nitrogens and carbons that have been "de-aromatized" in the mol2 example are labeled as aromatic in test_can.mol2 , and all bonds in the 5-membered ring have been marked as aromatic in the mol2 file.

This problem did not exist in openbabel 2.3.1 , but it is present in 2.3.2 and bleeding edge master.

Doing git bisect reveals that this patch introduced the problem:

https://github.com/openbabel/openbabel/commit/097636fd7cdba1c842d27a80ccab809c558d0b98#diff-d6e9941b72192e2ba1a2d244948450ae

Note, this patch does indeed fix pyridinium ions (they do not work before the patch and work after), it just happens to break my molecule :(.

1 Attachments

Discussion

  • cowsandmilk
    cowsandmilk
    2013-10-09

    I should add, all testing of this was done on Linux. And you can contact me (David Hall) at david (at) acpharis.com if you have questions or push fixes.

     
  • This should now be fixed in git master. The code now makes a distinction between 5-membered and 6-membered aromatic nH atoms.

     
    • status: open --> pending
    • assigned_to: Geoff Hutchison