emzed.chemistry.formula_parser module¶
- emzed.chemistry.formula_parser.parse_formula(mf, re=re.compile('\\s'))[source]¶
Returns Counter mapping (symbol, sassnumber) -> sount corresponding to mf. For symbols in mf, where no massnumber is specified, this funcion returns None as massnumber.
Eg.:
>>> parse_formula("[13]C2C4H") Counter({('C', None): 4, ('C', 13): 2, ('H', None): 1})