orthonym.rules.purine#

Note

Internal API. Names and behaviour may change between releases.

Systematic substituted-purine naming retained purine parent; fixed purine numbering; indicated H derived from the graph; / amine suffix).

Names a SUBSTITUTED purine ring system – the adenine/hypoxanthine/purine skeleton carrying ring-N substituents and/or exocyclic characteristic groups – as a whole-molecule parent (9-methyl-9H-purin-6-amine) and (Task 3) as a -yl substituent (6-amino-9H-purin-9-yl). Declines the bare retained bases (adenine/guanine/hypoxanthine) for their standard tautomers, which keep their retained names via another path.

Modelled on rules/purine_oxo.py: an atom-mapped skeleton SMARTS whose map numbers ARE the fixed IUPAC purine locants, per-structure indicated H derived from the actually-saturated ring nitrogen (NOT hardcoded, so it can never contradict the input tautomer on round-trip), fail-closed substituent collection, and reuse of the existing fused-heterocycle assembler.

Accuracy-first, fail-closed: returns None (caller falls through; the / OPSIN gate is the final backstop) unless the whole purine ring system is accounted for and every substituent is identifiable.

orthonym.rules.purine.name_substituted_purine(mol)#

Systematic PIN for a SUBSTITUTED purine, else None.

orthonym.rules.purine.name_purine_substituent(mol, frag_atoms, attach_idx)#

Name a purine ring-system fragment as a -yl substituent rooted at attach_idx (a ring atom). Returns <prefixes>-<indH>H-purin-<loc>-yl or None. C6-amino renders as the 6-amino PREFIX (purine is a substituent, not the parent). Indicated H derived from the graph (tautomer-safe).

Accuracy-first, fail-closed: declines an oxo-bearing fragment (Tier 1 substituent scope is non-oxo, the same boundary as name_substituted_purine) and any detachable-suffix decoration (carboxylic acid etc.) elsewhere on the ring, which this simple -yl builder cannot combine correctly.

orthonym.rules.purine.name_oxo_purine(mol)#

Systematic PIN for a substituted mono-6-oxo purine – the hypoxanthine or guanine family – else None.

Declines (fail-closed):
  • the bare parent (unsubstituted hypoxanthine, or guanine whose only exocyclic feature is the defining C2-amino) -> keeps its retained name via another path;

  • a 2,6-dione (purine_oxo.py’s job) or any extra ring oxo (8-oxo / trione) – the pinned single C6=O in the SMARTS means a second ring =O is picked up as an unaccepted ‘oxo’ substituent by the shared identifier, so this declines those structurally, defense-in-depth alongside the caller’s ordering (purine_oxo / xanthine run first);

  • any substituent the shared identifier can’t type as plain alkyl/halogen/bare-amino (fail-closed).

This engine owns the -oxo case (hypoxanthine/guanine family) only. The purine-2,6-DIONE case (xanthine/caffeine family) lives in rules/purine_oxo.py::name_purine_26_dione.