A Python package for representing reaction networks and simulating their behaviors
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
rxnnet
tests
.gitignore
README.md
setup.py

README.md

rxnnet

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

Prerequisites

Usage examples

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()