*Note: this is the Complexes.ipynb notebook. The PDF version "Bond Graph Representation of Complexes: Bringing Graph Theory to Bond Graphs" is available here.*
Chemical Reaction Network theory uses the formal concept of complexes.
Complexes are the combination of chemical
species forming the substrate and products of the network reactions. In particular, the stoichiometric matrix $N$ can be decomposed as:
\begin{equation}
\label{eq:ZD}
N = ZD
\end{equation}
where $Z$ relates complexes to species and $D$ is the incidence matrix of the directed graph formed by taking the
complexes to be vertices and the reactions to be edges.
This digraph can then be analysed using standard graph theory.
This notion can be given a bond graph interpretation (Gawthrop and Crampin, 2018). This notebook illustrates complexes using examples from this paper; please see the paper for further explanation.
As noted by (Gawthrop and Crampin, 2018) the digraphs for systems with and without chemostats are very different and so both are shown in the following examples. The digraphs associated with chemostats are related to bond graph pathway analysis (Gawthrop and Crampin, 2017); for each of the three examples the corresponding pathways are given.
The bond graph analysis uses a number of Python modules:
## Some useful imports
import BondGraphTools as bgt
import numpy as np
import sympy as sp
import matplotlib.pyplot as plt
import IPython.display as disp
## Stoichiometric analysis
import stoich as st
## SVG bg representation conversion
import svgBondGraph as sbg
## Set quiet=False for verbose output
quiet = True
The bond graph representation of the (reversible) enzyme-catalysed reaction is (Gawthrop and Crampin, 2018):
disp.SVG('RE_abg.svg')
This graphical representation may be converted to bond-graph tools format using
sbg.model('RE_abg.svg')
import RE_abg
The reactions corresponding to this system are:
s = st.stoich(RE_abg.model(),quiet=quiet)
disp.Latex(st.sprintrl(s,chemformula=True))
disp.Latex(st.sprintl(s,'species'))
disp.Latex(st.sprintl(s,'reaction'))
disp.Latex(st.sprintl(s,'N'))
disp.Latex(st.sprintl(s,'Z'))
disp.Latex(st.sprintl(s,'D'))
st.draw(s)
chemostats = ['A','B']
sc = st.statify(s,chemostats=chemostats)
st.draw(sc)
sp = st.path(s,sc)
print(st.sprintp(sc))
disp.Latex(st.sprintrl(sp,chemformula=True))
1 pathways 0: + r1 + r2
This example looks at bond graph representation of a membrane transporter which is discussed in detail by (Gawthrop and Crampin, 2017) and analysed by (Gawthrop and Crampin, 2018).
disp.SVG('Hill_abg.svg')
This graphical representation may be converted to bond-graph tools format using
sbg.model('Hill_abg.svg')
import Hill_abg
The reactions corresponding to this system are:
s = st.stoich(Hill_abg.model(),quiet=quiet)
disp.Latex(st.sprintrl(s,chemformula=True))
disp.Latex(st.sprintl(s,'species'))
disp.Latex(st.sprintl(s,'reaction'))
disp.Latex(st.sprintl(s,'N'))
disp.Latex(st.sprintl(s,'Z'))
disp.Latex(st.sprintl(s,'D'))
st.draw(s)
chemostats = ['Mi','Mo','Li','Lo']
sc = st.statify(s,chemostats=chemostats)
st.draw(sc)
sp = st.path(s,sc)
print(st.sprintp(sc))
disp.Latex(st.sprintrl(sp,chemformula=True))
1 pathways 0: + e + em + es + esm + lem + lesm
sbg.model('Hills_abg.svg')
import Hills_abg
disp.SVG('Hills_abg.svg')
The reactions corresponding to this system are:
s = st.stoich(Hills_abg.model(),quiet=quiet)
disp.Latex(st.sprintrl(s,chemformula=True))
chemostats = ['Mi','Mo','Li','Lo']
sc = st.statify(s,chemostats=chemostats)
st.draw(sc)
sp = st.path(s,sc)
print(st.sprintp(sc))
disp.Latex(st.sprintrl(sp,chemformula=True))
2 pathways 0: + e + em + es + esm + lem + lesm 1: + e + em + es + slip