A Python package for representing reaction networks, and computing their structures and behaviors. Currently the core of it is implemented as a wrapper of SloppyCell.
Mathematically, a reaction network can be represented as dx/dt = N v(x,p), where x, v and p are the concentration, rate and parameter vectors, respectively and N is the stoichiometry matrix.
Examples of structures:
- Stoichiometry matrix N
- Left and right null spaces of N
- Reduced stoichiometry matrix Nr (a selection of N's rows with trivial left null space) and link matrix L where N = L Nr
Examples of behaviors:
- Dynamics x(t)
- Steady states s = x(inf) and J = v(s, p)
- Parameter sensitivities of them dx(t)/dp, Rs = ds/dp and RJ = dJ/dp
- elasticities Ep = dv/dp and Ex = dv/dx
- control matrices Cs = -(N Es)-1 N and CJ = I + Es Cs
SloppyCell
pandas
numpy
matplotlib
(optional; for plotting dynamics)scipy
(optional; for using rootfinding to get steady states)sage
(optional; for getting the integer-valued null spaces of a stoichiometry matrix)libsbml
(optional; for importing and exporting SBML files)
import rxnnet
net = rxnnet.network.Network('net')
net.add_compartment(id='env')
net.add_compartment(id='cell')
net.add_species(id='C1', compartment='env', initial_value=2, is_constant=True)
net.add_species(id='C2', compartment='env', initial_value=1, is_constant=True)
net.add_species(id='X', compartment='cell', initial_value=0)
net.add_reaction(id='R1', eqn='C1<->X', ratelaw='k1*(C1-X)', p={'k1':1})
net.add_reaction(id='R2', eqn='X<->C2', ratelaw='k2*(X-C2)', p={'k2':2})
traj = net.integrate((0,10))
traj.plot()