chemistry_tools.formulae.utils

Attention

This module has the following additional requirements:

cawdrey>=0.5.0
mathematical>=0.5.1
pyparsing>=2.4.6
tabulate>=0.8.9

These can be installed as follows:

python -m pip install chemistry-tools[formulae]

General utility functions.

Data:

GROUPS

Common chemical groups

Functions:

hill_order(symbols)

Returns an iterator over the given element symbols in order of Hill notation.

split_isotope(string)

Returns the symbol and mass number for the isotope represented by string.

GROUPS = {'Abu': 'C4H7NO', 'Acet': 'C2H3O', 'Acm': 'C3H6NO', 'Adao': 'C10H15O', 'Aib': 'C4H7NO', 'Ala': 'C3H5NO', 'Arg': 'C6H12N4O', 'Argp': 'C6H11N4O', 'Asn': 'C4H6N2O2', 'Asnp': 'C4H5N2O2', 'Asp': 'C4H5NO3', 'Aspp': 'C4H4NO3', 'Asu': 'C8H13NO3', 'Asup': 'C8H12NO3', 'Boc': 'C5H9O2', 'Bom': 'C8H9O', 'Bpy': 'C10H8N2', 'Brz': 'C8H6BrO2', 'Bu': 'C4H9', 'Bum': 'C5H11O', 'Bz': 'C7H5O', 'Bzl': 'C7H7', 'Bzlo': 'C7H7O', 'Cha': 'C9H15NO', 'Chxo': 'C6H11O', 'Cit': 'C6H11N3O2', 'Citp': 'C6H10N3O2', 'Clz': 'C8H6ClO2', 'Cp': 'C5H5', 'Cy': 'C6H11', 'Cys': 'C3H5NOS', 'Cysp': 'C3H4NOS', 'Dde': 'C10H13O2', 'Dnp': 'C6H3N2O4', 'Et': 'C2H5', 'Fmoc': 'C15H11O2', 'For': 'CHO', 'Gln': 'C5H8N2O2', 'Glnp': 'C5H7N2O2', 'Glp': 'C5H5NO2', 'Glu': 'C5H7NO3', 'Glup': 'C5H6NO3', 'Gly': 'C2H3NO', 'Hci': 'C7H13N3O2', 'Hcip': 'C7H12N3O2', 'His': 'C6H7N3O', 'Hisp': 'C6H6N3O', 'Hser': 'C4H7NO2', 'Hserp': 'C4H6NO2', 'Hx': 'C6H11', 'Hyp': 'C5H7NO2', 'Hypp': 'C5H6NO2', 'Ile': 'C6H11NO', 'Ivdde': 'C14H21O2', 'Leu': 'C6H11NO', 'Lys': 'C6H12N2O', 'Lysp': 'C6H11N2O', 'Mbh': 'C15H15O2', 'Me': 'CH3', 'Mebzl': 'C8H9', 'Meobzl': 'C8H9O', 'Met': 'C5H9NOS', 'Mmt': 'C20H17O', 'Mtc': 'C14H19O3S', 'Mtr': 'C10H13O3S', 'Mts': 'C9H11O2S', 'Mtt': 'C20H17', 'Nle': 'C6H11NO', 'Npys': 'C5H3N2O2S', 'Nva': 'C5H9NO', 'Odmab': 'C20H26NO3', 'Orn': 'C5H10N2O', 'Ornp': 'C5H9N2O', 'Pbf': 'C13H17O3S', 'Pen': 'C5H9NOS', 'Penp': 'C5H8NOS', 'Ph': 'C6H5', 'Phe': 'C9H9NO', 'Phepcl': 'C9H8ClNO', 'Phg': 'C8H7NO', 'Pmc': 'C14H19O3S', 'Ppa': 'C8H7O2', 'Pro': 'C5H7NO', 'Prop': 'C3H7', 'Py': 'C5H5N', 'Pyr': 'C5H5NO2', 'Sar': 'C3H5NO', 'Ser': 'C3H5NO2', 'Serp': 'C3H4NO2', 'Sta': 'C8H15NO2', 'Stap': 'C8H14NO2', 'Tacm': 'C6H12NO', 'Tbdms': 'C6H15Si', 'Tbu': 'C4H9', 'Tbuo': 'C4H9O', 'Tbuthio': 'C4H9S', 'Tfa': 'C2F3O', 'Thi': 'C7H7NOS', 'Thr': 'C4H7NO2', 'Thrp': 'C4H6NO2', 'Tips': 'C9H21Si', 'Tms': 'C3H9Si', 'Tos': 'C7H7O2S', 'Trp': 'C11H10N2O', 'Trpp': 'C11H9N2O', 'Trt': 'C19H15', 'Tyr': 'C9H9NO2', 'Tyrp': 'C9H8NO2', 'Val': 'C5H9NO', 'Valoh': 'C5H9NO2', 'Valohp': 'C5H8NO2', 'Xan': 'C13H9O'}

Type:    Dict[str, str]

Common chemical groups

hill_order(symbols)[source]

Returns an iterator over the given element symbols in order of Hill notation.

Example:

>>> for i in hill_order("H", "C[12]", "O"): print(i, end='')
CHO
Return type

Iterator[str]

split_isotope(string)[source]

Returns the symbol and mass number for the isotope represented by string.

Valid isotopes include '[C12]', 'C[12]' and '[12C]'.

Parameters

string (str)

Return type

Tuple[str, int]

Returns

Tuple representing the element and the isotope number.