orthonym.rules.seniority#

Note

Internal API. Names and behaviour may change between releases.

Functional group seniority rules for principal group selection.

Based on IUPAC 2013 Blue Book to. The principal group (highest seniority) becomes the suffix; all other groups become prefixes.

orthonym.rules.seniority.get_principal_group(mol, functional_groups)#

Determine the principal characteristic group.

The principal group is the highest-seniority functional group that will be expressed as a suffix in the name.

Parameters:
  • mol – RDKit Mol object

  • functional_groups (Dict[str, List[tuple]]) – Dict from detect_functional_groups

Returns:

Tuple of (group_name, list_of_atom_index_tuples) Returns (None, ) if no suffix-capable group found

Return type:

Tuple[str | None, List[tuple]]

orthonym.rules.seniority.without_ring_skeleton_amidine(functional_groups, ring_atoms)#

functional_groups with the ‘amidine’ class removed when every amidine of the molecule has its carbon and both nitrogens among ring_atoms (a ring or ring system), else the dict unchanged.

“Suffixes for amidines” (the Blue Book): the amidine group is the

characteristic group “-C(=NH)-NH2” “attached to a cyclic parent hydride” (:34200); a ring that holds the whole N=C-N unit has those three atoms as skeletal atoms of the heterocycle (a tetrahydropyrimidine, the octahydropyrimido[1,2-a]azepine of 1,8-diazabicyclo[5.4.0]undec-7-ene), so no ‘-imidamide’ suffix stands on it and the ring system is the parent. A group of another kind that the ring carries is still seen once the skeletal amidine is set aside.

orthonym.rules.seniority.guanidine_parent_matches(mol, matches)#

The guanidine matches (N, C, =N, N) of matches whose carbon is not a ring atom: the ones the retained parent ‘guanidine’ can name.

“Guanidine and its derivatives” (the Blue Book): “The preferred IUPAC

name for the ‘amidine’ related to carbonic acid, H2N-C(=NH)-NH2, is the retained name ‘guanidine’”, an acyclic parent hydride with the locants N, N’ and N’’. The carbon of a guanidine has three nitrogen neighbours and no other, so a ring that runs through it holds two of those nitrogens as skeletal atoms: the unit is part of a heterocycle (the ring system of 1,3,4,6,7,8-hexahydro-2H-pyrimido[1,2-a]pyrimidine, the 4,5-dihydro-1H-imidazole of 2-amino- imidazoline), the ring system is the parent “Systems composed of rings and chains”, the Blue Book,:19340 “Within the same class, a ring or ring system has seniority over a chain”), and no guanidine stands on it.

orthonym.rules.seniority.ring_skeleton_units_resolved(mol, functional_groups, ring_atoms)#

functional_groups as seen from the ring system ring_atoms: an amidine or a guanidine whose carbon is one of its skeletal atoms is a feature of the ring, not a group of its own.

A unit with all of its nitrogens among ring_atoms is the heterocycle itself and is set aside (without_ring_skeleton_amidine, guanidine_parent_matches). A unit whose one exocyclic nitrogen is a terminal single-bonded -NH2 has its other nitrogens in the ring and that -NH2 is the amino group of an amine: “Primary amines, R-NH2, are systematically named in the following ways” (the Blue Book), substitutive ‘-amine’ (1-benzofuran-2-amine (PIN), :26193; quinolin-4-amine (PIN),:26199), so the unit is replaced by a ‘primary_amine’ match (N, C) and ranks as one. A unit with any other exocyclic part (a substituted amino, the =NH of an imine, an acylated nitrogen) is kept unchanged: it is not the plain amine this function can name. Groups of other kinds are untouched.

orthonym.rules.seniority.get_suffix(fg_name, is_ring=False)#

Get the suffix form for a functional group.

Parameters:
  • fg_name (str) – Name of functional group

  • is_ring (bool) – True if the group is attached to a ring (not terminal on chain)

Returns:

Suffix string, or None if group has no suffix form

Return type:

str | None

orthonym.rules.seniority.get_prefix(fg_name)#

Get the prefix form for a functional group.

Used when the group is not the principal group.

Parameters:

fg_name (str) – Name of functional group

Returns:

Prefix string, or None if group has no standard prefix form

Return type:

str | None

orthonym.rules.seniority.compare_seniority(fg1, fg2)#

Compare seniority of two functional groups.

Parameters:
  • fg1 (str) – Names of functional groups

  • fg2 (str) – Names of functional groups

Returns:

-1 if fg1 is higher seniority

0 if equal seniority (or both not in list) 1 if fg2 is higher seniority

Return type:

int