orthonym.rules.n_substituted_acids#

Note

Internal API. Names and behaviour may change between releases.

The substituent on the nitrogen of an imidic, sulfonimidic or hydroxamic acid group is a prefix like the others.

“Substitutive nomenclature, suffix mode” (the Blue Book,:30096): “Acids in which the

carbonyl oxygen atom of a carboxylic acid group has been replaced by =N-OH are named as N-hydroxy derivatives of imidic acids named as described in.” The N-hydroxy of that name is one case of a substituent on the N of the group, and the book prints the others: ‘N-sulfanylcyclopentanecarboximidic acid (PIN)’ “Functional replacement in systematic names of carboxylic acids”,:30271), ‘N-{[({[(2-oxoethyl)amino]sulfanyl}methyl)amino]oxy}ethanimidothioic acid (PIN)’,:30039), ‘N-ethyl-N-methylcarbamimidic acid (PIN)’,:30764), and for the acids of sulfur ‘N-hydroxymethanesulfonimidic acid (PIN)’ “Hydroximic and hydroxamic acids derived from sulfonic, sulfinic, etc. acids”,:31230,:31234). A hydroxamic acid is the N-hydroxy amide,:30144;

“Hydroxamic acids”,:32821: ‘N-hydroxypropanamide (PIN)’, ‘N-hydroxycyclohexanecarboxamide (PIN)’).

The substituent on the N of an imidic acid is a carbon group in the same way (‘N-methylethanimidic acid’, ‘N-methylethanimidothioic acid’: ASSUMED – the book prints none with a carbon group on the N of a carboximidic acid, only the carbamimidic acid above) and, as ‘sulfanyl’ is, the other terminal chalcogen groups.

So each of these groups is written with the suffix of its own parent acid (the imidic acid of the group’s chalcogen, the amide, the sulfonimidic acid) and the substituent of its N is cited with the other prefixes in ONE alphanumerical series “ALPHANUMERICAL ORDER”,:3436,:3440; ‘N,4-dimethyl-N-(3-methylphenyl)benzamide (PIN)’,:32879, puts the italic N and the numbers in one list), under the italic locant N, which is essential

“Citation of locants”,:2869) so that no licence withholds a locant beside it, and one that

the parent also carries is one multiplied prefix (b),:7067): ‘N,2-dimethylpropanimidic acid’.

The groups were named by handlers that put ‘N-hydroxy’ in front of the finished name of the parent acid (handlers/hydroxamic_acid.py, handlers/sulfonimidic_n_hydroxy.py), which is right only when that name has no prefix of its own: ‘N-hydroxy1-chloromethanesulfonimidic acid’, nothing for ‘N-hydroxy-2-methylpropanamide’, and a group of an N with a carbon group was the name of an imine and a thiol, or of nothing. This module is the one place that reads the N of the group; hydroximic_acids keeps what only the carboximidic acids have (the configuration of the C=N, the prefixes of the demoted group, the benzene tables).

Not built, and left to the producers that name every structure: more than one group of the molecule that has an N-substituent, a substituent on the N that is neither a terminal OH nor a carbon group, a carbon group that has a functional group of its own (it would be cited twice: as the substituent and as a group of the parent), a group whose acid carbon has a heteroatom beside it (a carbonic acid derivative), and the group demoted by a senior one (no prefix for it is printed by the book for a carbon group on the N).

orthonym.rules.n_substituted_acids.IMIDIC_GROUP = {'O': 'imidic_acid', 'S': 'imidothioic_acid', 'Se': 'imidoselenoic_acid', 'Te': 'imidotelluroic_acid'}#

the imidic acid whose N-substituted derivative a group is, by the chalcogen of its acid group

orthonym.rules.n_substituted_acids.N_PREFIX_GROUPS = frozenset({'hydroxamic_acid', 'hydroximic_acid', 'n_substituted_imidic_acid', 'sulfinimidic_acid', 'sulfonimidic_acid'})#

the groups whose N-substituent is cited as a prefix

orthonym.rules.n_substituted_acids.CN_GROUPS = frozenset({'hydroximic_acid', 'n_substituted_imidic_acid'})#

the groups whose C=N carries a configuration the standard InChIKey does not see (its mobile hydrogen)

orthonym.rules.n_substituted_acids.suffix_group(mol, fg_name, matches)#

The group whose suffix fg_name is written with (‘hydroximic_acid’ -> ‘imidic_acid’, ‘hydroxamic_acid’ -> ‘primary_amide’,…).

The group’s own table row has no suffix (SUFFIX_FORMS['hydroximic_acid'] is None: the ‘-hydroximic acid’ suffix is general nomenclature only,:30100; the ‘-hydroxamic acid’ suffix is not used for a PIN,:30144). matches are the group’s atom tuples, of the first of which the chalcogen is read. Every other group is its own.

orthonym.rules.n_substituted_acids.suffix_group_atoms(fg_name, matches)#

The atoms the suffix of a principal group accounts for: its matches, less the oxygen on the nitrogen of a hydroximic or hydroxamic acid, which is the atom of the N-hydroxy prefix.

orthonym.rules.n_substituted_acids.n_substituents(mol, fg_name, match, functional_groups=None, *, named=True)#

[(name, atoms)] of the substituents on the N of the group match; ```` for a group whose N has none (‘methanesulfonimidic acid’) and for a group that is not one of:data:N_PREFIX_GROUPS; None where the group is not built (see the module docstring).

named=False reads the structure only: the name of a carbon group is None and the group is not asked of the naming pipeline, whose answer may depend on the naming context (the tier, the substituent cache), so that perception, which is cached as a pure function of the molecule (assembly/memo.py), stays one. A carbon group that the pipeline then cannot name makes the producer decline (n_plan()).

The substituent is a terminal OH (‘hydroxy’) or SH, SeH, TeH (‘sulfanyl’…: only the OH on a hydroxamic acid) or a hydrocarbon group named from its point of attachment by the pipeline that names every substituent (rules.amides._name_n_substituent, which the N-substituents of an amide are named by). A hydroxamic acid is the OH alone: C(=O)N(R)OH is a tertiary amide.

orthonym.rules.n_substituted_acids.n_plan(features)#

[(name, atoms)] of the N-substituents features’ principal group cites as prefixes (````: none, or the group is not one of:data:N_PREFIX_GROUPS), or None where the group is not built.

One group only: two of them would need the N locants to carry the numbers of their groups (‘N1,N4-dihydroxybutanediimidic acid’, the Blue Book). A sulfonimidic acid several times over with no substituent on any N is the plain disulfonimidic acid and unchanged.

orthonym.rules.n_substituted_acids.scope_n_substituted_imidic_acids(mol, functional_groups)#

Keep the n_substituted_imidic_acid matches of functional_groups only where the group is built, else drop the key (the molecule is then read as before: the =N-R as an imine, the -XH as a thiol or alcohol).

The group has a name only as the principal group: the book prints no prefix for a carbon group on the N of an imidic acid demoted by a senior group (the prefix for the unsubstituted group is ‘C-hydroxycarbonimidoyl’,

(1), the Blue Book, ‘hydroxy’ with ‘imino’ at a chain end, (2),:30021), so where another

group is senior to it, or of its rank, the imine and the thiol or alcohol keep their own prefixes (the same scoping _detect_functional_groups_impl gives the chalcogen anhydrides under a senior acid). Dropped too: more than one such group (n_plan() builds one), and a group whose N-substituent is not one the producers cite (n_substituents()). The test reads the structure only (named=False): perception is a pure function of the molecule; whether the substituent’s name can be built is the producer’s decision.

orthonym.rules.n_substituted_acids.group_at_rank(mol, functional_groups, fg_name)#

(group, matches) of the hydroximic or N-substituted imidic acids of functional_groups whose rank is fg_name’s: those whose imidic acid it is; (None, ) for a fg_name that is not one of the four.

class 7a (the Blue Book): the ‘Suffix’ acids are “each followed in turn by the

corresponding peroxy, imidic, and hydrazonic acids. Chalcogen analogues follow each of the corresponding oxygen acids”. The N-substituted derivative of an imidic acid is that acid for the order of citation as principal group,:30129: the prefix forms are for the case “When another group is present that has seniority for citation as principal group”), so it ranks as the imidic acid of its acid chalcogen: with the imidic acid for the O acid, with the imidothioic, imidoselenoic or imidotelluroic acid for the S, Se or Te acid, and above the hydrazonic acids.

orthonym.rules.n_substituted_acids.rank_group(mol, fg_name, matches)#

The group in SENIORITY_ORDER whose place fg_name has: the imidic acid of its chalcogen for a hydroximic or N-substituted imidic acid class 7a, the Blue Book), the group itself for every other.

orthonym.rules.n_substituted_acids.render_n_prefix(name)#

‘N-methyl’, ‘N-(2-chloroethyl)’, ‘N-hydroxy’: the substituent name on the N, as one block.

orthonym.rules.n_substituted_acids.ring_anchored_atoms(mol, fg_name, matches, ring_atoms)#

Atoms of the groups matches of fg_name (one of:data:N_PREFIX_GROUPS) whose acid atom is bonded to an atom of ring_atoms: the suffix of the ring, with the N-substituent the group cites itself.

composer.ring_anchored_pg_atoms counts a group anchored to a ring only by a CARBON bonded to it (the carboxylic acid, the carbaldehyde) and takes the atoms of the match, so the branch of a ring sulfonimidic acid (its S is the atom on the ring) and the group on the N of any of these groups was read as a substituent of the ring: a carbon group on the N came out as a stray ‘methyl’ prefix, and the ring suffix kept its locant beside it (‘N-methylcyclohexane-1-carboximidic acid’, where the book writes no locant for the monosubstituted ring, ‘N-sulfanylcyclopentanecarboximidic acid (PIN)’,:30271).

orthonym.rules.n_substituted_acids.group_nitrogens(features)#

The N atoms of the principal group when it is one of:data:N_PREFIX_GROUPS that is built, else none: the branch that holds such an N is the group’s own (its substituent is cited by the group as an italic-N prefix, with_n_prefix_fragments()), so the walk that names the parent’s substituents must not name it again (‘3-hydroxy-N-methyl-1-(methylamino)propanimidic acid’).

orthonym.rules.n_substituted_acids.n_prefix_strings(features)#

(group the suffix is written with, rendered N prefixes) of a molecule’s principal group.

For a group of:data:N_PREFIX_GROUPS that is built: its parent acid and [‘N-hydroxy’], [‘N-methyl’]…; for a group that is not built, and for every other principal group, the group itself and nothing: the caller finds no suffix for ‘hydroximic_acid’ and declines.

orthonym.rules.n_substituted_acids.n_italic_locant_cited(features, fragments)#

True when features is a group of:data:N_PREFIX_GROUPS whose name cites an italic N locant: the fragments hold a prefix that starts with it (‘N-hydroxy’, ‘N,2-dimethyl’, ‘N-(2-chloroethyl)’).

“Citation of locants” (the Blue Book): when any locant is essential all are cited, and an

italic N says which atom of the parent carries the group, so no position of that parent compound can be left without its locant. Every licence that empties a scope of its locants to

declines on it: the isomer a group on N would make is not the one on the carbon, whatever the

rest of the scope looks like. (The licences read the molecule’s hydrogens, and the N of this group holds none: its substituent is a position of the parent compound, not a decoration of the group.)

orthonym.rules.n_substituted_acids.with_n_prefix_fragments(features, prefixes)#

prefixes (name fragments) with the N-substituent of the principal group cited among them, or None.

The fragment carries its own locant in its text, as _generate_alkyl_prefixes does (‘2-methyl’), and text_without_locants is the same text: an N locant is essential and no licence withholds it. A prefix the chain or ring already carries under the substituent’s name is one multiplied prefix with it (‘N,2-dimethyl’, ‘N,2-dihydroxy’, (b)); the existing fragment is re-rendered from its own locants, and only when that re-rendering reproduces what the assembler would have printed for it (a fragment this cannot read back is refused, never edited). Unchanged for a group with no N-substituent; None (the caller declines) for a group that is not built (see:func:n_plan).