orthonym.validation.protonation_identity#

Note

Internal API. Names and behaviour may change between releases.

Protonation-site identity: does a name’s OPSIN parse carry its hydrons on the same atoms as the input structure?

The standard InChI moves every hydron of a protonated (onium) atom into one mobile /p layer, so the full standard InChIKey cannot tell WHICH atom carries the charge. Protonation isomers of one cation share one key:

C[NH2+]CCC(=O)NC vs CNCCC(=O)[NH2+]C (aminium vs amidium) C[NH2+]CCC#N vs CNCCC#[NH+] (aminium vs nitrilium) C[NH+](C)CCN vs CN(C)CC[NH3+] (tertiary vs primary aminium)

Every gate that accepts a name on full-key equality alone is therefore blind to a name that puts the ‘-ium’ on the wrong nitrogen (‘N-methyl-3-(methylamino)- propanamidium’ for the protonated amine). (the Blue Book) and Table 7.4 (:41417-41424) define ‘amidium’, ‘nitrilium’, ‘aminium’ as the cationic form OF that characteristic group, so such a name denotes a different species.

The same holds for a DEPROTONATED site, and for the hydron of a cation whose charge sits on a substituted atom. The standard InChI adds the missing hydron back (or takes the extra one off) and records it in the /p layer, so these share one key too:

O=C([O-])Cc1ccccc1C(=O)O.[Na+] vs O=C(O)Cc1ccccc1C(=O)[O-].[Na+] C[N+]1=CNc2ccccc21 vs C[NH+]1C=Nc2ccccc21

‘sodium 2-(carboxymethyl)benzoate’ is the second salt (the ring carboxylate is the anion); the first is ‘sodium (2-carboxyphenyl)acetate’. “Acid salts” (the Blue Book-31596): method (1) cites “the free acid… as a prefix to the name of the anion”, and an anion is senior to an acid, ‘4 Anions’ before ‘7 Acids’,:18167). ‘1-methyl-1H-benzimidazol-1-ium’ puts the added hydron on N-1, beside the methyl group; the first cation, with the hydron on N-3, is ‘1-methyl-1H-benzimidazol-3-ium’,:41368: the ‘ium’ cation is formed “by adding one or more hydrons to any position”; the example ‘1H-imidazol-3-ium (PIN)’,:41396).

Two rules, applied in order:

  1. When BOTH the input and the parse carry a protonated heavy atom (a positively charged non-hydrogen atom bearing hydrogen), the fixed-hydrogen InChI (/FixedH, stereo layers off) must be equal. The fixed-H layer records where each hydron sits, and InChI keeps charge-delocalised forms equal (the two resonance drawings of an amidinium or a 4-aminopyridinium give one fixed-H InChI), so a correct name is never rejected for drawing the charge on the other resonance atom.

  2. Otherwise, when both structures carry a charged atom, the input carries no bare proton ([H+], whose site the input leaves open) and the standard InChIs (stereo off) are equal – the case the standard key cannot see – unequal fixed-H InChIs are a mismatch unless one of three things explains the difference (the rule reads the name only in (c)): (a) a neutral tautomer only: the structures’ neutral analogues

    (_neutral_analogue_inchi: each charged atom replaced by its isoelectronic neutral atom, in any resonance drawing) share one standard InChI, so the charges sit on the same atoms and only neutral hydrons moved inside one mobile group (a 2-pyridone drawn as the 2-hydroxypyridine beside a nitro group) – the tautomer tolerance every gate keeps for a neutral molecule;

    1. the amino-acid zwitterion drawn in the neutral form: the parse is the input with ONE alpha-amino-acid pair neutralised, the hydron moved from the ammonium N to the carboxylate of the same R-CH(NH3+)-COO- unit (_neutralised_pair_matches). This is the part-molecule case of the zwitterion that (the Blue Book) names as the neutral amino acid (‘2-aminopropanoic acid rather than… 2-azaniumylpropanoate’); another pairing (the ammonium with a side-chain carboxylate or a sulfonate) is another protomer.

    2. only for a name that cites the acid hydrons with the method (2) word ‘hydrogen’ / ‘dihydrogen’ in the salt position, between the cation and the anion words (_names_acid_hydrons_without_site): the hydrons of noncarbon oxoacid groups sit on other acid chalcogens of EQUIVALENT central atoms of ONE connected component (_oxoacid_centre_hydron_key). A name that multiplies an ion word citing hydrogen (‘disodium bis(methyl hydrogen phosphate)’) names identical units: when the input is those identical units as drawn, their hydrons are pooled across the units (_names_multiplied_hydrogen_unit, _oxoacid_fragments_identical). (the Blue Book) names the acid salts of di- and polynuclear noncarbon oxoacids “in the same way as neutral salts, the remaining acid hydrogen atom(s) being indicated by the word ‘hydrogen’ (or ‘dihydrogen’, etc., as appropriate)”, and (:31619) the acid salts of organic derivatives of polybasic inorganic oxoacids by the same method (2); such a name does not place the hydrons among equivalent groups (‘disodium dihydrogen diphosphate’ and ‘disodium dihydrogen methanediphosphonate’ are read by OPSIN with both hydrons on one phosphorus). A hydron on a centre of another kind (the ester phosphorus of a methyl diphosphate, the sulfur of a sulfuric-phosphoric anhydride), or a substitutive name that places the hydrons (‘(dichloro-phosphonomethyl)phosphonate’), stays a mismatch.

    A hydron (or a charge) that moves to ANOTHER acid or base site is a different species.

Scoped on purpose: a salt drawn as its ionic pair and named as the neutral acid-base form (’…amine hydrochloride’, a proton on Cl), or an amino-acid zwitterion named as the neutral amino acid, has a parse with no charged atom and is not a protonation-SITE question; it keeps its existing treatment, judged by the callers’ own charge checks.

orthonym.validation.protonation_identity.protonation_site_verdict(input_smiles, parsed_smiles, name=None)#

"n/a", "ok" or "mismatch".

Both structures carry a protonated heavy atom: "ok" if the fixed-H InChIs are equal, else "mismatch" (rule 1 of the module docstring). Both carry a charged atom, the input has no bare proton and the standard InChIs (stereo off) are equal: "mismatch" if the fixed-H InChIs differ and neither a neutral tautomer, the neutralised amino-acid zwitterion pair nor – for a name with the method (2) ‘hydrogen’ word – the hydrons of equivalent oxoacid centres explain it (rule 2), else "n/a". Anything else is "n/a". name is the name whose parse parsed_smiles is; without it rule 2 (c) does not apply. An input or parse RDKit cannot read, or a fixed-H InChI that cannot be computed, is "n/a": the callers’ own checks decide those.