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.offered_principal_group(mol)#
(group_name, matches)of the oxoacid ester whose name is being built formolright now (the offer ofget_principal_group), else None. The amido prefix of an acylated nitrogen is cited in the name of that ester (assembly.n_acyl_amido.group_is_principal), so the question of whether the amide is the principal group is asked of the ester being offered, which outranks it.
- 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_groupswith the ‘amidine’ class removed when every amidine of the molecule has its carbon and both nitrogens amongring_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
matcheswhose 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_groupsas seen from the ring systemring_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_atomsis 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.seniority_index(fg_name, mol=None, matches=None)#
The place of
fg_nameinSENIORITY_ORDER(ValueError for a name that is not in it).THE one reader of the order for a group’s rank: a hydroximic or N-substituted imidic acid has the rank of the imidic acid of its acid chalcogen class 7a, the Blue Book;
hydroximic_acidin the order is the O acid’s place), somoland the group’smatchesgive it the place of its imidic, imidothioic, imidoselenoic or imidotelluroic acid, and two groups of one rank share an index. Without them the group is the O acid’s. Every other name is its own place.
- orthonym.rules.seniority.ESTER_ACID_ORDER = (('7a', frozenset({'ester', 'iminoester', 'pseudoester', 'selenoester', 'sulfinic_ester', 'sulfonic_ester', 'telluroester', 'thioester'})), ('7b', frozenset({'carbamate', 'carbamimidate'})), ('7c', frozenset({'arsinate_ester', 'phosphinate_ester', 'phosphonate_diester', 'stibinate_ester'})), ('7d', frozenset({'phosphate_diester', 'phosphate_monoester', 'phosphate_triester', 'phosphite_triester', 'sulfate_diester', 'sulfate_monoester'})))#
“Esters cited as prefixes” (:31696) keeps the ester of the senior acid as the parent and cites the other as a prefix (‘ethyl 2-[(ethoxy- carbonyl)oxy]-4,4-dimethyl-3-oxopentanoate (PIN)’, the carbonic ester in the prefix of the carboxylic one; ‘methyl 4- (phenoxysulfinothioyl)naphthalene-1-carboxylate (PIN)’, that of a sulfur acid), “Seniority for numbering follows that for acids”. The order of the acids is class 7 of Table 4.1 (:18170ff) and: class 7a “CLASS 7a. ACIDS EXPRESSED BY SUFFIXES”, carboxylic with its imidic and chalcogen analogues, sulfonic, sulfinic…) > class 7b “CLASS 7b. CARBON ACIDS WITH NO SUBSTITUTABLE HYDROGEN ATOMS”: carbonic acid, to which carbamic acid belongs, > class 7c, phosphonic, phosphinic, arsonic…) > class 7d, phosphoric, sulfuric,…). The functional-group keys of the esters of each class, senior class first; the one reader is:func:ester_acid_rank.
- Type:
class 9 “Esters” (the Blue Book) rank by the acid they are esters of
- orthonym.rules.seniority.ester_acid_rank(fg_name)#
The place of the acid of the class-9 ester group
fg_namein:data:ESTER_ACID_ORDER (0 is the senior class); None for a group that is not an ester there.
- 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