orthonym.rules#

Note

Internal API. Names and behaviour may change between releases.

Rules module - IUPAC nomenclature rules implementation.

Contains the classification logic that applies IUPAC rules to determine naming strategy, principal groups, and locants.

orthonym.rules.get_principal_group(mol, functional_groups)#

Determine the principal characteristic group.

The principal group is the highest-seniority functional group that will be expressed as a suffix in the name.

Parameters:
  • mol – RDKit Mol object

  • functional_groups (Dict[str, List[tuple]]) – Dict from detect_functional_groups

Returns:

Tuple of (group_name, list_of_atom_index_tuples) Returns (None, ) if no suffix-capable group found

Return type:

Tuple[str | None, List[tuple]]

orthonym.rules.get_suffix(fg_name, is_ring=False)#

Get the suffix form for a functional group.

Parameters:
  • fg_name (str) – Name of functional group

  • is_ring (bool) – True if the group is attached to a ring (not terminal on chain)

Returns:

Suffix string, or None if group has no suffix form

Return type:

str | None

orthonym.rules.get_prefix(fg_name)#

Get the prefix form for a functional group.

Used when the group is not the principal group.

Parameters:

fg_name (str) – Name of functional group

Returns:

Prefix string, or None if group has no standard prefix form

Return type:

str | None