orthonym.data.fusion_components#

Note

Internal API. Names and behaviour may change between releases.

Monocyclic component registry for algorithmic fused ring naming.

Provides a registry of common monocyclic ring components with their: - Fusion prefix form (e.g., ‘benzo’, ‘furo’, ‘pyrido’) - Ring size - Heteroatom types and IUPAC positions - Seniority for parent/child selection (lower = more senior) - Aromaticity flag

Used by fusion_descriptors.py to: 1. Identify ring components by their heteroatom pattern 2. Determine parent/child using IUPAC seniority 3. Generate correct fusion prefixes

IUPAC 2013 Seniority: - Nitrogen heterocycle > Oxygen heterocycle > Sulfur heterocycle > Carbocycle - Among same heteroatom class: larger ring > smaller ring - Among same size/heteroatom: more heteroatoms > fewer

Reference: IUPAC 2013 Blue Book, Section (Fused Ring Systems)

orthonym.data.fusion_components.get_component_by_pattern(ring_size, heteroatom_symbols, hetero_gap=None)#

Find a component name matching the given ring structure.

For rings with 2+ heteroatoms of the same type, the hetero_gap (shortest number of non-hetero atoms between heteroatoms walking around the ring) is required to distinguish positional isomers: - gap=0: adjacent (pyrazole, pyridazine, isoxazole, isothiazole) - gap=1: separated by 1 C (imidazole, pyrimidine, oxazole, thiazole) - gap=2: separated by 2 C (pyrazine)

Parameters:
  • ring_size (int) – Number of atoms in the ring

  • heteroatom_symbols (List[str]) – List of heteroatom element symbols (sorted)

  • hetero_gap (int | None) – Shortest gap between heteroatoms (for disambiguation)

Returns:

Component name (e.g., ‘pyrimidine’) or None if no match

Return type:

str | None

orthonym.data.fusion_components.get_component_seniority(name)#

Get the seniority value for a named component.

Lower seniority = more senior (preferred as parent in fusion naming). Returns 999 for unknown components.

Parameters:

name (str) – Component name (e.g., ‘pyrimidine’, ‘benzene’)

Returns:

Seniority value (int). Lower = more senior.

Return type:

int

orthonym.data.fusion_components.get_component_prefix(name)#

Get the fusion prefix form for a named component.

Returns the prefix used when this ring is the child (attached component) in a fusion name. Falls back to the name + ‘o’ if not in registry.

Parameters:

name (str) – Component name (e.g., ‘benzene’ -> ‘benzo’, ‘furan’ -> ‘furo’)

Returns:

Fusion prefix string

Return type:

str

orthonym.data.fusion_components.get_component_info(name)#

Get full property dict for a named component.

Parameters:

name (str) – Component name

Returns:

Property dict or None if not found

Return type:

Dict[str, Any] | None