Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add support for %(NNN) notation for SMILES ring closures #1677
The % notation only supports up to 99 ring closures. I have an example of a SMILES string from RDKit that goes beyond this (included in the tests).
An extension to this is the %(...) notation which could in theory support any arbitrary number. I've implemented this with support for up to 5 digits. I'm also in the process of proposing this change to RDKit.
I can't see any downside to supporting this notation on reading. On writing, the only alternative is to refuse to write the SMILES.
I've also tightened up the parsing of the normal % notation. The existing code accepted non-digits.
(Apologies for the small number of unrelated white-space changes - my editor seems to be doing this without asking.)
It's not standard, it's an extension. The example testcase I provide is a real-life SMILES string that contains more than 99 open rings. We don't have control over what SMILES strings other tools generate. (Rereading this, I sound grumpy - I'm not :-) - by the way, just checked your papers - would be good to get some of your xtallography stuff into Open Babel)