# How to canonicalize SMILES written with aromatic bond symbols (:)?

I am using a package called PySmiles and it is returning a dialect of SMILES for aromatic groups that uses aromatic bond symbols e.g. NC:1:N:N:C:[N]1N.

RDKit does not recognize these symbols and it removes all the aromaticity.

Interestingly, Openbabel Version 2.3.2 successfully canonicalizes this to Nc1nncn1N but version 3.1.0 produces NC1NNCN1N similar to what RDKit produces.

I've opened an issue on the Github Openbabel to address this issue but I'd like to ask it here (i.e. why does do versions 2.3.2 and 3.1.0 in OpenBabel give different results?) since this might be a general issue related to SMILES dialects.

• This looks like SMARTS, not SMILES. In RDKit, Chem.MolFromSmarts('NC:1:N:N:C:[N]1N') looks like it loads it correctly. You can see the : character and other definitions on daylight.com/dayhtml/doc/theory/theory.smarts.html May 21 at 2:08

I think it might be good to have a look at SELFIES by Alan Aspuru-Guzik and co-workers: https://github.com/aspuru-guzik-group/selfies From what I remember from his talk in Girona last December, this should do better than SMILES for many systems, which you can also infer from the title of the corresponding paper: "Self-Referencing Embedded Strings (SELFIES): A 100% robust molecular string representation".

tldr; That SMILES is invalid

This was answered on GitHub by Noel O'Boyle, but I wanted to provide more context.

First off, versions:

• I had to go back and check, but Open Babel 2.3.2 was released in October 2012
• Version 3.0 and later implement the Daylight SMILES aromaticity model and have a thoroughly rewritten SMILES code (by Noel).

So why do the different versions give different results? Because 2.3.2 has a very forgiving aromaticity model and it's wrong.

In particular, as noted by Noel, SMILES defines aromaticity through atoms:

Atom aromaticity in SMILES is determined by the case of the characters, not by the nature of the attached bonds.

Since the characters are in caps, SMILES indicates they are non-aromatic atoms.

But let's not limit ourselves to Open Babel and RDKit. I tried that SMILES in ChemDraw:

I also tried your SMILES with the NIH resolver, which runs CACTVS here. It returns a 404 error, in essence the SMILES is invalid.

I don't know your project, but if you want to use SMILES, you should use a full toolkit like RDKit, Open Babel, or Open Eye -- they have years of testing.

And depending on your needs, SELFIES might work. I don't remember if it includes all features in SMILES yet, but it's designed for robust ML and has proven utility in a number of recent papers.