orthonym.validation.radical_identity#

Note

Internal API. Names and behaviour may change between releases.

Radical identity: does a name’s OPSIN parse carry the same radical centres as the input structure?

The full standard InChIKey encodes neither radical electrons nor bond order, so it cannot tell a radical from a closed-shell or differently placed twin with the same formula and connectivity:

[CH2][CH2] vs C=C (ethane-1,2-diyl vs ethene) [O]c1ccc([O])cc1 vs O=C1C=CC(=O)C=C1 (a bis(oxyl) vs p-benzoquinone) CN(C)[O] vs C[N+](C)[O-] (an aminoxyl vs its charge form) [CH2]C=CC vs C=C[CH]C (two allyl-type radical sites)

Every gate that accepts a name on full-key equality alone is therefore radical-blind. This module is the one definition of the stricter rule, applied whenever the input or the parse carries a chemical radical:

  1. the radical profile (element and radical-electron count of every radical atom) must be equal – this also rejects a lambda-convention name whose parse is a radical for a closed-shell input, and the reverse;

  2. the stereo-stripped canonical isomeric SMILES must be equal – graph identity over element, charge, hydrogen count, isotope, bond order and radical placement. Stereo is left to the caller’s own stereo logic.

Radical electrons on most METAL atoms are not counted: RDKit’s valence model assigns them to bare cations such as [Pb+2] or [Sn+2] and to covalent metal centres, and they are not chemical radicals in the sense of. The p-block metals Al, Ga, In, Sn, Tl, Pb, Bi and Po are the exception, because names radicals on them (‘stannyl’ the Blue Book, ‘plumbyl’:38069, ‘alumanyl’ :15900) and the key cannot place them either: [SnH2][SnH2][SnH3] (tristannan-1-yl) and [SnH3][SnH][SnH3] (tristannan-2-yl) share one InChIKey. A radical electron on one of these counts unless the atom is drawn as a salt: a bare ion (no neighbour, no hydrogen, charged) or an atom with no hydrogen whose neighbours are all salt-like (N, O, F, S, Cl, Se, Br, Te, I) – so ‘tin(II) dichloride’ ([Sn+2].2[Cl-], parsed as Cl[Sn]Cl) stays “n/a”. Transition metals and groups 1/2 stay excluded (Cu+2, Mn+2 and Cl[Mg] carry RDKit radical counts).

One named whole-molecule exemption: dioxygen, the retained name for O2 (data/retained_names.py), whose ground state is the triplet [O][O] while OPSIN draws O=O; says radical names “do not indicate nor imply an electronic structure or spin multiplicity” (the Blue Book).

orthonym.validation.radical_identity.radical_profile(mol)#

Sorted (element, radical electrons) of every radical centre: each non-metal radical atom, and each p-block-metal radical atom not drawn as a salt.

orthonym.validation.radical_identity.radical_identity_verdict(input_smiles, parsed_smiles)#

"n/a" when neither side carries a chemical radical (the caller’s own checks decide), else "ok" or "mismatch". A radical input whose parse RDKit cannot read is a "mismatch" (fail closed).