Frequently Asked Questions (FAQs)

Have a question? Try searching the FAQs!

How do I install MASSpy?

There are several ways to install MASSpy. To use pip to install MASSpy from PyPI

pip install masspy

Check out the Quick Start Guide to learn more about getting started!

How do I cite MASSpy?

A manuscript is in preparation for publication and will be the proper reference for citing the MASSpy software package in the future. In the meantime, feel free to cite the preprint [HZK+20], which can be found at bioRxiv.

How do I change the rate expression for a reaction?

Use the MassModel.add_custom_rate() method.

[1]:
import mass.test

model = mass.test.create_test_model("textbook")
Using license file /Users/zhaiman/opt/licenses/gurobi.lic
Academic license - for non-commercial use only

When metabolites are added to reactions, MASSpy will generates rate expressions automatically based on mass action kinetics and the kinetic reversibility given by the MassReaction.reversible attribute.

[2]:
print(model.reactions.PGI.rate)
kf_PGI*(g6p_c(t) - f6p_c(t)/Keq_PGI)

If a reaction is associated with a model, a custom rate expression can be set using the MassModel.add_custom_rate() method. The add_custom_rate() method requires the corresponding reaction object and a string representing the custom rate expression to set. For example, to set a simple Michaelis Menten rate expression with \(V_{max}\) and \(K_{m}\) parameters:

[3]:
custom_parameter_dict = {"vmax_PGI": None, "Km_PGI": None}

model.add_custom_rate(
    model.reactions.PGI,
    custom_rate="(vmax_PGI * g6p_c)/(Km_PGI + g6p_c)",
    custom_parameters=custom_parameter_dict)
print(model.reactions.PGI.rate)
vmax_PGI*g6p_c(t)/(Km_PGI + g6p_c(t))

The reaction rate expression is converted from a string to a symbolic expression using the sympy.sympify() function. All metabolites and standard reaction parameters (i.e. returned by the MassReaction.all_parameter_ids), and boundary conditions are recognized. However, all additional parameters must be set as a custom parameter in the MassModel.custom_parameters attribute.

[4]:
print("Recognized Parameters: {!r}".format(model.reactions.PGI.all_parameter_ids))
print("Custom Parameters: {!r}".format(list(custom_parameter_dict)))
Recognized Parameters: ['kf_PGI', 'Keq_PGI', 'kr_PGI', 'v_PGI']
Custom Parameters: ['vmax_PGI', 'Km_PGI']

Additional information about the underlying sympify() function can be found here.