#484 CML roundtripping of aromaticity problem


On Friday 27 April 2007, Nina Jeliazkova wrote:

Here is the story.
1) Create (somehow) a structure as IMolecule (e.g. benzene with
alternating single/double bonds)
2) Run HueckelAromaticityDetector to perceive aromaticity
3) Write the structure into CML
4) Read the structure back from CML into a new IMolecule
5) Now the new IMolecule has bond orders 1.5 , while the origin one as in
1) has bond orders 1.0 and 2.0

Ah... that sounds like a bug. CDK in the early days used 1.5 bond order == an aromatic bond, but drop that in favour of IBond.setFlag(CDKConstancs.ISAROMATIC). Seems that the CMLReader has not been updated.

This doesn't break isomorphism test and fingerprints, but does break atom
types recognition as per HybridizationStateATMatcher. In this example,
atom types of the original molecule will be C.sp2, while in the new
molecule will be Caromatic.sp2.

Atom type perception is a tricky thing indeed. What suprises me that the first type is not aromatic too! Because you did do atomiticity detection. Actually, since the atom type list contains the the concept of aromaticity, it must be done prior to calling the perception tool. Maybe a second bug?

Not sure this breaks anything else than my atom environments code, but I am
wondering what's the best way to handle the issue.

Attached is JUnit test.



  • Egon Willighagen

    Logged In: YES
    Originator: YES

    I solved this by not storing aromatic bonds like:

    <bond order="A"/>

    but with:

    <bond order="1">
    <bondType dictRef="cdk:aromaticBond"/>

    see commit 8301.

  • Nina Jeliazkova

    Nina Jeliazkova - 2008-08-24

    Logged In: YES
    Originator: NO

    This solved the issue with bond aromaticity flags, however, atom aromaticity flag is lost in the CML roundtrip.

  • Egon Willighagen

    Reopened with respect to the atom aromaticity.

  • John May

    John May - 2015-01-01

    I presume this is fixed/quirk of CML. Marking for closure.