17.1.1.1.1.3. cobra.core.formula

17.1.1.1.1.3.1. Module Contents

17.1.1.1.1.3.1.1. Classes

Formula

Describes a Chemical Formula

cobra.core.formula.element_re[source]
class cobra.core.formula.Formula(formula=None)[source]

Bases: cobra.core.object.Object

Describes a Chemical Formula

Parameters

formula (string) – A legal formula string contains only letters and numbers.

__add__(self, other_formula)[source]

Combine two molecular formulas.

Parameters

other_formula (Formula, str) – string for a chemical formula

Returns

The combined formula

Return type

Formula

parse_composition(self)[source]

Breaks the chemical formula down by element.

property weight(self)[source]

Calculate the mol mass of the compound

Returns

the mol mass

Return type

float

cobra.core.formula.elements_and_molecular_weights[source]