orthonym.rules.spiro_carbocycle#

Note

Internal API. Names and behaviour may change between releases.

The component name of a carbocyclic monocycle in a spiro system, with its double bonds.

One namer for every spiro builder that cites a carbocyclic ring as a component (spiro[cyclohexane-1,1'-indene]): a saturated ring is cyclo<stem>ane; a ring with double bonds cites them with the ring’s own locants, cyclohex-2-ene, cyclopent-3-ene, cyclohexa-2,4-diene.

Governing rules (the Blue Book Blue Book):

  • ‘Monospiro ring systems with different ring components at least one being a polycyclic ring and at least one ring component requiring the use of skeletal replacement (‘a’) nomenclature’ (:10272), Explanation of the second example (:10291): “The spiro atom of the monocyclic hydrocarbon component is given preference for low locant.” The spiro atom of the ring is locant 1.

  • ‘Spiro compounds composed of unsaturated rings’, (:16715): “Low locants are assigned to double bonds in accordance with the fixed numbering of the spiro compound.” The direction round the ring gives the double bonds the lowest locants.

  • ‘Unbranched polyspiro ring systems with different ring components one being a polycyclic ring system’ (:10705), (:10719): “If there is a choice of locants, the lowest set of locants for all spiro atoms is selected when compared in increasing numerical order and, if there is still a choice, in order of their citation in the name”. A ring that carries two spiro atoms (the middle ring of a polyspiro system) numbers the junction toward the earlier-cited component 1 (the caller passes it as spiro_center), gives the other junction the lowest locant the ring allows, and only then looks at the double bonds.

  • (:16497): “when the endings ‘ene’ and ‘yne’ are preceded by a multiplying prefix and a locant the letter ‘a’ is inserted”: cyclohexa-2,4-diene.

  • NUMBERING (:3219), criteria (c) ‘principal characteristic groups and free valences (suffixes)’ (:3256), (e) ‘saturation/unsaturation’ (:3288, “low locants are given to hydro/dehydro prefixes… and ‘ene’ and ‘yne’ endings”) and (f) (:3301) “detachable alphabetized prefixes, all considered together in a series of increasing numerical order”. The direction takes them in that order after the spiro junctions. The ring is numbered before any suffix is chosen, so the callers of today pass no suffix_atoms; a direction that puts a double bond lower than a ketone locant is still a correct name of the structure, never a different one.

The Blue Book’s own spelling for a monocyclic component with a double bond is the ‘ene’ ending after the closing bracket, ‘Spiro compounds’ (:17042), example:17052: ‘4,5-dihydro-3H-spiro[[1]benzofuran-2,1’-cyclohexan]-2’-ene (PIN)’. OPSIN 2.9.0 has no grammar for it (it reads spiro[indene-1,1'-cyclohex-2-ene]), so the name built here is the spelling of the component itself, not the PIN; the callers label it below the PIN.

orthonym.rules.spiro_carbocycle.component_substituent_locants(mol, component_atoms, skip, locant_of)#
The sorted locants of the ring atoms of a component that carry an exocyclic substituent

(f), the Blue Book): the key a numbering tie of a monocycle component is broken by.

skip are the spiro atoms (their locants are fixed by; locant_of maps atom index -> locant.

orthonym.rules.spiro_carbocycle.name_carbocyclic_monocycle_component(mol, component_atoms, spiro_center, *, other_spiro_atoms=(), substituent_tiebreak=False, suffix_atoms=())#

Name a single CARBOCYCLIC ring component of a spiro system, numbering it with locant 1 at the spiro atom (the side-ring convention). Returns (cyclo<N>ane / cyclo<stem>a-<enes>-diene / -ene, {orig_idx: locant}) or None for a heteroatom ring (fail-closed).

tail #7: a ring bearing C=C (the spiro-cyclohexadienone side of a

spiro-quinone alkaloid) is now rendered as the mancude cyclohexa-2,5-diene component. The double-bond locants are cited UNPRIMED here; the caller’s spiro assembler is responsible for the primed/unprimed placement of the OTHER (non-first-cited) component and RT-verifies the whole name . The numbering walks from the spiro atom (locant 1) in the direction giving the C=C set the lowest locants; a saturated ring is byte-identical to the old output (no ene infix).

other_spiro_atoms (a ring that carries more than one spiro atom,: the direction first gives those atoms the lowest locants; suffix_atoms (the ring atoms that carry the principal characteristic group or a free valence, (c)) come next, then the double bonds (e)). substituent_tiebreak: when the double bonds tie (a ring unsaturated symmetrically about the spiro atom, cyclopent-3-ene, cyclohexa-2,5-diene), take the direction that gives the ring atoms bearing an exocyclic substituent the lowest locants as a set (f)); otherwise a tie keeps the first direction, as it always did.

orthonym.rules.spiro_carbocycle.name_unsaturated_carbocyclic_side_ring(mol, side_ring, spiro_center=None)#

The component name of a carbocyclic spiro SIDE ring that has a double bond, with the double-bond locants in the ring’s own numbering (cyclohex-2-ene, cyclohexa-2,4-diene), for the builders that name a side ring on its own (rules/spiro.py::_name_side_ring).

spiro_center is the ring’s spiro atom when the caller knows it (a masked spiro atom is not in get_spiro_atoms): it is locant 1. A ring with two spiro atoms (the middle ring of a polyspiro chain) is numbered from the one the caller passes, the junction toward the earlier-cited component,:10719); without one the choice would come from RDKit’s ring order, so the ring is not named here. Returns None too when the ring has no known spiro atom or when name_carbocyclic_monocycle_component declines (a triple or aromatic ring bond): the caller then keeps its older name, which a read-back rejects.