orthonym.rules.sulfur#
Note
Internal API. Names and behaviour may change between releases.
Sulfur compound naming rules per IUPAC 2013.
IUPAC: Sulfur-containing functional groups: - Thiols (-SH): suffix -thiol, prefix sulfanyl- - Sulfides (R-S-R’): the PIN is SUBSTITUTIVE — (R’-sulfanyl)RH, method (1)
(the Blue Book “Method (1), substitutive nomenclature, gives preferred IUPAC names”; the Blue Book “(methylsulfanyl)methane (PIN)… dimethyl sulfide”). The functional-class “R R’ sulfide” (method 2) below is retained for GENERAL nomenclature only; on the PIN path the thioether handler (assembly/handlers/thioether.py) declines the neutral case so the substitutive producer names it, and name_sulfide only serves the charged degrade.
Sulfoxides (R-SO-R’): functional class naming
Sulfones (R-SO2-R’): functional class naming
Sulfonic acids (-SO3H): suffix -sulfonic acid, prefix sulfo-
- orthonym.rules.sulfur.name_thiol(mol, thiol_atoms, parent_name, locant=None)#
Name a thiol compound with -thiol suffix.
- Parameters:
mol – RDKit Mol object
thiol_atoms (Tuple[int, ...]) – Atom indices from SMARTS match (S, C)
parent_name (str) – Parent chain/ring name without suffix
locant (int | None) – Position of thiol group (None if implied)
- Returns:
Name like “methanethiol”, “propane-1-thiol”
- Return type:
str
- orthonym.rules.sulfur.name_sulfide(mol, sulfur_idx)#
Build the functional-class (method 2) name of a sulfide (thioether).
⚠ This is NOT the PIN. Per (the Blue Book) the preferred IUPAC name of a chalcogen analogue of an ether is the SUBSTITUTIVE form “(R’-sulfanyl)RH” (method 1); the functional-class “R R’ sulfide” is retained for general nomenclature only. The thioether handler declines the neutral acyclic case so the substitutive producer emits the PIN, and calls this only for the CHARGED degrade (a dithiocarbamate ammonium, a nitrile-sulfide ylide) where the substitutive route would misroute — keeping a valid, non-PIN name (0-wrong).
Functional-class grammar method 2): - Symmetric: “dimethyl sulfide”, “diethyl sulfide” - Asymmetric: “ethyl methyl sulfide” (alphabetical order,
- Parameters:
mol – RDKit Mol object
sulfur_idx (int) – Index of sulfur atom
- Returns:
Functional class name, or None if not a simple sulfide
- Return type:
str | None
- orthonym.rules.sulfur.name_sulfoxide(mol, sulfoxide_atoms)#
Name a sulfoxide using functional class nomenclature.
IUPAC prefers functional class for simple sulfoxides: - Symmetric: “dimethyl sulfoxide” - Asymmetric: “ethyl methyl sulfoxide” (alphabetical order,
- Parameters:
mol – RDKit Mol object
sulfoxide_atoms (Tuple[int, ...]) – Atom indices from SMARTS match
- Returns:
Functional class name, or None if not a simple sulfoxide
- Return type:
str | None
- orthonym.rules.sulfur.name_sulfone(mol, sulfone_atoms)#
Name a sulfone using functional class nomenclature.
IUPAC prefers functional class for simple sulfones: - Symmetric: “dimethyl sulfone” - Asymmetric: “ethyl methyl sulfone” (alphabetical order,
- Parameters:
mol – RDKit Mol object
sulfone_atoms (Tuple[int, ...]) – Atom indices from SMARTS match
- Returns:
Functional class name, or None if not a simple sulfone
- Return type:
str | None
- orthonym.rules.sulfur.name_sulfonic_acid(mol, sulfonic_atoms, parent_name)#
Name a sulfonic acid with -sulfonic acid suffix.
- Parameters:
mol – RDKit Mol object
sulfonic_atoms (Tuple[int, ...]) – Atom indices from SMARTS match
parent_name (str) – Parent chain/ring name
- Returns:
Name like “methanesulfonic acid”, “benzenesulfonic acid”
- Return type:
str
- orthonym.rules.sulfur.name_sulfonyl_halide(features, style='pin')#
/ /: the acid halide of a sulfonic / sulfinic acid, named by the two-word functional-class grammar ‘{parent-stem}sulfonyl {halide}’ / ‘{parent-stem}sulfinyl {halide}’.
BB-verbatim targets: ‘ethanesulfonyl chloride’ (, PIN), ‘propane-1-sulfonyl chloride’, ‘4-isocyanatobenzene-1-sulfonyl chloride (PIN)’ .
Implementation (root-cause reuse, not a band-aid): cap the S-bonded halogen with -OH to form the parent sulfonic/sulfinic acid, name that acid with the full engine — reusing ALL chain/ring numbering (yields ‘propane-1-sulfonic acid’ / ‘ethanesulfonic acid’ / ‘benzenesulfonic acid’, substituents and all) — then rewrite the ‘-onic/-inic acid’ suffix to the acyl ‘-onyl/-inyl {halide}’ functional-class word. Fail-closed (None) unless the capped molecule names cleanly as a sulfonic/sulfinic acid, so a wrong name is never emitted.
- orthonym.rules.sulfur.name_chalcogen_oxide_substitutive(mol, match_atoms, oxide_kind)#
substitutive PIN for R-S(=O)-R’ / R-S(=O)(=O)-R’ (Wave2 T3b).
BB-verbatim targets: ‘(methanesulfinyl)methane’ (46154, DMSO), ‘1-(ethanesulfinyl)butane’ (28094), ‘(ethanesulfonyl)ethane’ (28115), ‘(methanesulfinyl)benzene’, “1,1’-sulfinyldibenzene” (28110, symmetric diaryl multiplicative; ‘Multiplication of acyclic hydrocarbons is not permitted’ — identical chains stay substitutive).
- Parameters:
mol – RDKit Mol.
match_atoms (Tuple[int, ...]) – sulfoxide/sulfone SMARTS match (S first).
oxide_kind (str) – ‘sulfinyl’ (one =O) or ‘sulfonyl’ (two =O).
- Returns:
The substitutive name, or None (caller keeps functional class).
- Return type:
str | None
- orthonym.rules.sulfur.chalcogen_oxide_fc_covers_molecule(mol, match_atoms)#
Wave2 conservation guard for the functional-class sulfoxide/ sulfone namers: their name describes EXACTLY R-S(=O)x-R’, so it is only honest when S + its =O oxygens + both full side fragments account for every heavy atom in the molecule. ‘CSCCS(=O)C’ used to emit ‘ethyl methyl sulfoxide’ — the alkyl walk stopped at the second S, silently dropping -S-CH3 (a different molecule). On False the handler declines and the polyfunctional path names the whole structure.
- orthonym.rules.sulfur.get_sulfur_prefix(fg_name)#
Get prefix form for sulfur functional groups.
- Returns:
Prefix string, or None if group uses functional class naming
- Return type:
str | None