Molecular Mass Calculations
Project description
Calculate the molecular mass (average, nominal, and isotopic pure), the elemental composition, and the mass distribution spectrum of a molecule given by its chemical formula, relative element weights, or sequence. Calculations are based on the isotopic composition of the elements. Mass deficiency due to chemical bonding is not taken into account. Examples of valid formulas are H2O, [2H]2O, CH3COOH, EtOH, CuSO4.5H2O, (COOH)2, AgCuRu4(H)2[CO]12{PPh3}2, CGCGAATTCGCG, and MDRGEQGLLK. Formulas are case sensitive and + denotes the arithmetic operator, not an ion charge.
For command line usage run python -m molmass --help
- Author:
- Version:
2018.8.15
Requirements
Revisions
- 2018.8.15
Move module into molmass package.
- 2018.5.29
Add option to start web interface from console.
- 2018.5.25
Style and docstring fixes. Make ‘from_fractions’ output deterministic.
- 2005.x.x
Initial release.
Examples
>>> from molmass import Formula >>> f = Formula('D2O') # heavy water >>> f.formula # hill notation '[2H]2O' >>> f.empirical '[2H]2O' >>> f.mass # average mass 20.027603556 >>> f.isotope.massnumber # nominal mass 20 >>> f.isotope.mass # monoisotopic mass 20.0231181781 >>> f.atoms 3 >>> print(f.composition()) Element Number Relative mass Fraction % 2H 2 4.028204 20.1133 O 1 15.999400 79.8867 Total: 3 20.027604 100.0000 >>> print(f.spectrum()) Relative mass Fraction % Intensity 20.023118 99.757000 100.000000 21.027335 0.038000 0.038093 22.027364 0.205000 0.205499
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for molmass-2018.8.15-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7b63ff2921b21f282c284fcec8321f3c92ce0168997723284c7078aae473e73 |
|
MD5 | 28b0c399ff6b91ea18895ee5f42f0483 |
|
BLAKE2b-256 | 1622d19375b980699d3b0e4d76e828f7d395294077a537be12156c24c2d5625a |