emzed.optimized.formula_fit module¶
- emzed.optimized.formula_fit.formula_table(min_mass, max_mass, c_low, c_high, h_low, h_high, n_low, n_high, o_low, o_high, p_low, p_high, s_low, s_high, h_to_c_min, h_to_c_max, n_to_c_min, n_to_c_max, o_to_c_min, o_to_c_max, p_to_c_min, p_to_c_max, s_to_c_min, s_to_c_max, mass_C, mass_H, mass_N, mass_O, mass_P, mass_S, apply_rule_2, apply_rule_6)¶
This is a reduced Python version of HR2 formula generator, see http://fiehnlab.ucdavis.edu/projects/Seven_Golden_Rules/Software/
This function generates a table containing molecular formulas consisting of elements C, H, N, O, P and S having a mass in range [min_mass, max_mass]. For each element one can provide an given count or an inclusive range of atom counts considered in this process.
If apply_rule_2 is True, mass ratio rules (from “seven golden rules”) and valence bond checks are used to avoid unrealistic compounds in the table, else all formulas explaining the given mass range are generated.
Putting some restrictions on atomcounts, eg C=(0, 100), can speed up the process tremendously.