Giter Site home page Giter Site logo

gabenavarro / molmass Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cgohlke/molmass

0.0 0.0 0.0 94 KB

Molecular Mass Calculations. Forked from https://pypi.org/project/molmass

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

molmass's Introduction

Molecular Mass Calculations

Molmass is a Python library and console script to 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:Christoph Gohlke
License:BSD 3-Clause
Version:2020.1.1

Requirements

Revisions

2020.1.1
Update elements.py to version 2020.1.1. Remove support for Python 2.7 and 3.5. Update copyright.
2018.8.15
Move modules 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.02760855624
>>> f.isotope.massnumber  # nominal mass
20
>>> f.isotope.mass  # monoisotopic mass
20.02311817581
>>> f.atoms
3
>>> print(f.composition())
Element  Number  Relative mass  Fraction %
2H            2       4.028204     20.1133
O             1      15.999405     79.8867
Total:        3      20.027609    100.0000
>>> print(f.spectrum())
Relative mass    Fraction %      Intensity
20.023118         99.757000     100.000000
21.027335          0.038000       0.038093
22.027363          0.205000       0.205499

molmass's People

Contributors

cgohlke avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.