Example: BioCircuit
This example is a purely artificial biochemical network that illustrates
different pathway modeling objects and how they are transformed into
mathematical expressions. The model can be launched in PathwayLab
Research Edition from the Start menu, but its pathway diagram is also
shown as plain graphics in the figure below. The file BioCircuit.nb^{*} used below was generated by
Export to > Mathematica in the PathwayLab menu.
The BioCircuit pathway
Load the package.
In[1]:=
Load the model and store it in a variable.
In[2]:=
Out[2]=
State variables in a pathway model correspond to concentrations of entities described by a set of ordinary differential equations—the rate equations. The full names of these variables are given by their location; see the figure above.
This lists the state variables of the pathway.
In[3]:=
Out[3]=
A rate variable of a pathway model corresponds to the rate of a
transformation (reaction or translocation) between two entities. The units
of a rate variable are either given in amount per time or in concentration
per time depending on the settings in the Formula Settings dialog window
for the transformation object in PathwayLab Research Edition. In addition to the state and rate variables, there are variables describing compartment volumes and auxiliary entities (described by explicit functions of time). The model variables are defined by expressions containing parameters and states.
This lists the rate variables of the pathway.
In[4]:=
Out[4]=
This lists all nonstate variables of the pathway model.
In[5]:=
Out[5]=
This lists the model variables that are not rates.
In[6]:=
Out[6]=
The expressions defining the model variables can be can be extracted as a list of rules.
In[7]:=
Out[7]=
This gives the rate expression for rate r1.
In[8]:=
Out[8]=
Here are the parameters of the model.
In[9]:=
Out[9]=
The values of the parameters are given by a list of rules.
In[10]:=
Out[10]=
This provides the list of parameter rules, using TableForm
for nice formatting.
In[11]:=
Out[11]//TableForm=
r1`Vm→1 
r1`Km→1 
r1`Ki→0.2 
r10`Vm→1 
r10`Km→1 
r3`alpha→0.2 
r4`consrateE→1 
NucleusVolume`Membrane`r6`Dconst→0.2 
r2`Vm→1 
r2`Km→1 
r5`Vm→1 
r5`Km→1 
MembraneArea`Area→0.01 
MembraneArea`r8`Vm→0.1 
MembraneArea`r8`Km→0.4 
MembraneArea`r9`k0→0.2 
MembraneArea`r9`Km→1 
r7`kf→0.5 
r7`kr→0.01 
This provides the rate expression for rate r1 when the parameters have been replaced by their default numerical values.
In[12]:=
Out[12]=
The rate equations (or reaction rate equations) of a pathway model are a set of differential equations describing the time evolution of the entity concentrations.
This gives the rate equations for the pathway model.
In[13]:=
Out[13]=
Here are the rate equations when the parameters have been replaced by their numerical values.
In[14]:=
Out[14]=
Rate equations can also be presented in mass balance format, relating rate of change of entity concentrations with the transformation rates. Because entity concentrations are used as state variables there is also a term in each differential equation corresponding to dilution for timevarying volumes. Rates defined as absolute (in terms of amount per time) will be divided by the volume of the compartment or location containing the entity to obtain the corresponding concentration flow rate.
Here are the rate equations in mass balance format.
In[15]:=
Out[15]=
This provides the rate equations in mass balance format assuming constant volume and area of the locations.
In[16]:=
Out[16]//TableForm=
The rate equations in symbolic form (given by the default usage of RateEquations) are obtained by substituting the expressions for the model variables intlo the rate equations in mass balance format.
In[17]:=
Out[17]=
Given the rate equations and a set of initial conditions, the model can
be simulated using NDSolve.
Store the rate equations, states, and initial conditions in variables.
In[18]:=
Out[20]=
Simulate the system for 40 seconds.
In[21]:=
Out[21]=
This plots state variables x4 and NucleusVolume`x4.
In[22]:=
This changes the parameter r5`Vm to 2.
In[24]:=
Here is a new plot of x4 and NucleusVolume`x4.
In[26]:=
This compares x4 and NucleusVolume`x4 for the default and new value of r5`Vm.
In[27]:=
Because simulation of the rate equations with default parameter values
and initial conditions is a common operation, the PathwayLab
package
implements an extension of NDSolve for this particular task.
Simulate the rate equations for the model using default parameter values and initial conditions.
In[28]:=
Out[29]=
This plots rate variables NucleusVolume`Membrane`r6[t] and
r7[t]. Additional options defined by the Graphics`Legend`
standard package are used to add a legend to the plot. Observe the usage
of ModelVariableRules and ParameterRules to obtain the
symbolic expressions for the rates. Note the use below of ReplaceRepeated
(//.) instead of ReplaceAll
(/.), which is required in general but not for this particular model.
In[30]:=
One way to understand how sensitive a pathway model is with respect to changes in a particular parameter is to make a number of simulations for different values of the parameter.
Replace the parameter r5`Vm with a dummy variable Vm and replace the remaining parameters with their default values.
In[34]:=
Solve the rate equations for Vm between 0.5 and 1.5 in steps of 0.1.
In[35]:=
Plot the solutions for x4.
In[36]:=
* Note: If you do not own a copy of
Mathematica, you will need to download a
trial
version in order to
view the notebook document.
