Skip to content
AsciiC6hem

Ring closures

Ring closures let you bond non-adjacent atoms using SMILES-style digit suffixes. Two atoms with the same digit become bonded.

A digit after an atom opens or closes a ring:

Source Rendered
C1-C-C-C-C-C1
C 1 - C - C - C - C - C 1

This is cyclohexane: the first C1 and the last C1 are bonded, closing the ring.

Different digits open different rings:

Source Rendered
C1-C2-C-C1-C2
C 1 - C 2 - C - C 1 - C 2

Rings 1 and 2 are independent.

An atom can open/close multiple rings simultaneously:

Source Rendered
C12-C-C1-C2
C 12 - C - C 1 - C 2

This opens rings 1 and 2 on the first atom, closes ring 1 on the third atom, and closes ring 2 on the fourth.

Ring closures work inside groups:

Source Rendered
(C1-C-C-C-C-C1)
( C 1 - C - C - C - C - C 1 )
((C1-C-C1))
( ( C 1 - C - C 1 ) )
Ca(C1-C-C1)
Ca ( C 1 - C - C 1 )

The group structure is preserved alongside the ring bond through CML round-trip.

Ring closure bonds appear as regular <bond> elements in CML, connecting the ring-closure atoms. The digit itself is preserved via the aci:ringClosures attribute so the round-trip is lossless:

<atom id="a1" elementType="C" aci:ringClosures="1"/>
...
<atom id="a6" elementType="C" aci:ringClosures="1"/>
<bond id="b6" atomRefs2="a1 a6" order="S"/>

The UnclosedRingCheck linter catches ring closure digits that have no matching partner:

Source Rendered
C1-C-C
C 1 - C - C

This produces: [error] Atom(C): Atom has unmatched ring closure digit(s) "1".

Play