$ ./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:
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 :(.
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.