orthonym.rules.lactams#

Note

Internal API. Names and behaviour may change between releases.

Monocyclic lactam naming using IUPAC heterocyclic replacement nomenclature.

Lactams are cyclic amides. Monocyclic lactams are named as heterocyclic ketones: the ring nitrogen gives the heterocyclic parent name (aza-prefix via Hantzsch-Widman), and the carbonyl is expressed as a -one suffix.

Naming algorithm: 1. Detect lactam: ring contains -N-C(=O)- where both N and C are in the

same ring, and the exocyclic O is a double-bonded carbonyl.

  1. Distinguish lactam from imide: N bonded to exactly 1 ring C=O (lactam) vs 2 ring C=O (imide like succinimide).

  2. Determine ring size.

  3. For ring size 3-10: Get HW heterocyclic parent name (azetidine, pyrrolidine, piperidine, azepane, etc.) from build_hw_name.

  4. Apply vowel elision if needed and append ‘-2-one’.

Reference: IUPAC 2013 Blue Book, (Lactams), (Replacement)

Examples

C1CC(=O)N1 (beta-lactam) -> azetidin-2-one C1CCC(=O)N1 (gamma-lactam) -> pyrrolidin-2-one C1CCCC(=O)N1 (delta-lactam) -> piperidin-2-one C1CCCCC(=O)N1 (epsilon-lactam) -> azepan-2-one

orthonym.rules.lactams.is_monocyclic_lactam(mol)#

Detect whether a molecule is (or contains) a monocyclic lactam.

A monocyclic lactam has: - A ring containing an amide motif: -N-C(=O)- where both the amide

nitrogen and the carbonyl carbon are in the same ring.

  • The carbonyl oxygen is exocyclic (double-bonded to the carbonyl C).

  • The nitrogen is bonded to exactly ONE ring C=O (not an imide).

  • The ring is not fused with another ring (monocyclic only).

Parameters:

mol – RDKit Mol object (or None).

Returns:

Dict with detection info if lactam found – ring_atoms: tuple of atom indices in the lactam ring

nitrogen_idx: atom index of the ring nitrogen carbonyl_idx: atom index of the carbonyl carbon (C=O) carbonyl_o_idx: atom index of the exocyclic carbonyl oxygen ring_size: number of atoms in the ring

None if not a monocyclic lactam.

Return type:

Dict | None

orthonym.rules.lactams.name_lactam_ring(ring_size)#

Get the IUPAC name for a monocyclic lactam of a given ring size.

For ring sizes 3-10: uses retained parent names (pyrrolidine, piperidine) where available, falling back to Hantzsch-Widman systematic naming. Applies vowel elision and appends ‘-2-one’.

Parameters:

ring_size (int) – Number of atoms in the lactam ring (3-50 supported).

Returns:

IUPAC name string (e.g., ‘pyrrolidin-2-one’), or None if ring size is not supported.

Return type:

str | None

Examples

>>> name_lactam_ring(4)
'azetidin-2-one'
>>> name_lactam_ring(5)
'pyrrolidin-2-one'
>>> name_lactam_ring(6)
'piperidin-2-one'
>>> name_lactam_ring(7)
'azepan-2-one'
orthonym.rules.lactams.name_monocyclic_lactam(mol)#

Generate the IUPAC name for a monocyclic lactam, including substituents.

Detects whether the molecule is a monocyclic lactam and returns its name using heterocyclic replacement nomenclature with -one suffix. Substituents on the ring are included as prefixes with locants.

Parameters:

mol – RDKit Mol object (or None).

Returns:

IUPAC name string (e.g., ‘pyrrolidin-2-one’, ‘3-methylazetidin-2-one’), or None if the molecule is not a monocyclic lactam.

Return type:

str | None

Examples

>>> from rdkit import Chem
>>> mol = Chem.MolFromSmiles('C1CCC(=O)N1')
>>> name_monocyclic_lactam(mol)
'pyrrolidin-2-one'