two_reaction_model_with_encapsulation_doc

A Simple Two Reaction Pathway Model with Encapsulation

A Simple Two Reaction Pathway Model with Encapsulation

Author:
        Melanie Nelson (Physiome Sciences Inc.)
Collaborators:
        Warren Hedley (Bioengineering Institute, University of Auckland)
        Poul Nielsen (Bioengineering Institute, University of Auckland)

Introduction

This document continues the demonstration of recommended “best practices” for marking up models of biochemical reactions in CellML begun in the basic reaction example and the two reaction model. The current example extends the two reaction example by adding encapsulation.

It is assumed that you are already familiar with the basic reaction example and the two reaction model. Concepts covered in these examples are not duplicated here.

You might find it helpful to refer to a full printout of the CellML document that makes up this example as you progress through this documentation. The various forms available online are presented in the section “Download This Model”.

Basic Model Structure

This model defines the reversible reaction:

A + B + 2E <-> 2F

The total reaction is composed of two elementary reactions:

A + B <-> 2C + D
C + E <-> F

The conventional rendering (pathway diagram) for the simple two reaction model is shown in Figure 1. In this rendering the reactants and products are shown as rounded rectangles on opposite ends of bidirectional arrows representing the reaction.

the conventional rendering of the simple two reaction model
Figure 1. The conventional rendering (pathway diagram) for the simple two reaction model.

In CellML, models are thought of as connected networks of discrete components. These components may correspond to physiologically separated regions or chemically distinct objects, or may be useful modelling abstractions. This simple two reaction model has eight components representing chemically distinct objects (six chemical species and two reactions) and two components defined purely for modelling convenience: the component that represents the total reaction, which will be used to encapsulate other parts of the model and another “abstract” component which will store variables such as time. The CellML rendering of the simple two reaction model is shown in Figure 2 (the different shapes in the diagram are explained in the notation guide).

the cellml rendering of the simple reaction model
Figure 2. A network diagram for the simple two reaction example. The model has a component for each of the chemical species, a component for each elementary reaction, and an “abstract” component that represents the total reaction. The model also has a second “abstract” component, not shown on this diagram, that is used as a convenient container for the variable time. The variables in the model are shown next to the components in which their value may be modified, and alongside the connections along which they are passed to other components (where their value may not be modified).

Analysis of the XML

The model element and declaration of units

The root <model> element of the CellML document for this model is identical to the corresponding element in the simple electrophysiological model, and the set of <units> elements (with which a set of named units is created for use in the model) is extremely similar to the set defined in the simple electrophysiological model (readers should refer to the analysis of that model for discussion of these parts of the model).

The total_reaction component

The components in this model are very similar to the components in the unencapsulated two reaction model. The primary difference is the addition of a new component to represent the overall, or total, reaction. This component is shown in Figure 3.




<component name="total_reaction">

<variable

name="A" public_interface="in"

private_interface="out" units="concentration_units" />

<variable

name="B" public_interface="in"

private_interface="out" units="concentration_units" />

<variable

name="E" public_interface="in"

private_interface="out" units="concentration_units" />

<variable

name="F" public_interface="in"

private_interface="out" units="concentration_units" />

<variable

name="time" public_interface="in"

private_interface="out" units="second" />



<variable

name="delta_A" public_interface="out"

private_interface="in" units="concentration_units" />

<variable

name="delta_B" public_interface="out"

private_interface="in" units="concentration_units" />

<variable

name="delta_E" public_interface="out"

private_interface="in" units="concentration_units" />

<variable

name="delta_F" public_interface="out"

private_interface="in" units="concentration_units" />



<reaction>

<variable_ref variable="A">

<role

role="reactant" direction="forward"

stoichiometry="1" />

</variable_ref>

<variable_ref variable="B">

<role

role="reactant" direction="forward"

stoichiometry="1" />

</variable_ref>

<variable_ref variable="E">

<role

role="reactant" direction="forward"

stoichiometry="1" />

</variable_ref>

<variable_ref variable="F">

<role

role="product" direction="forward"

stoichiometry="2" />

</variable_ref>

</reaction>



</component>



Figure 3. The definition of the total_reaction component. This component represents the overall reaction defined by the model.

The first set of variables in this component (A, B, E, F, and time) are imported from unencapsulated (sibling) components (public_interface="in") and passed on to encapsulated components (private_interface="out"). These variables are required by the encapsulated reactions and species.

The delta variables (delta_A, delta_B, delta_E, and delta_F), which represent the changes in the concentrations of the corresponding species due to the reaction process, are imported from encapsulated components (private_interface="in") and exported to the rest of the network (public_interface="out"). In this way the delta variables are exposed to the rest of the model. Note that the chemical species C and D are completely hidden by the encapsulation. These chemical species can not be used outside of the encapsulated intermediate reactions. For this reason a modeller would normally only encapsulate chemical species components that represent uninteresting by-products of an intermediate reaction.

The group component

Encapsulation is represented in CellML using the <group> element. The group element indicating the encapsulation relationship between the total_reaction component and its subcomponents is shown in Figure 4. The participants in the group are named in <component_ref> elements. The <component_ref> elements nest inside other <component_ref> elements in order to indicate how the components relate to one another. A <relationship_ref> element with a relationship attribute value of "encapsulation" signifies that the components first_reaction, second_reaction, C, and D are logically encapsulated by the total_reaction component, and, therefore, are hidden from components A, B, E, F, and environment. For a better understanding of grouping hierarchies, see Section 6.2 of the CellML specification.




<group choice="opt" rep="norepeat"><relationship_ref relationship="encapsulation" /><component_ref component="total_reaction">

<component_ref component="first_reaction" />

<component_ref component="second_reaction" />

<component_ref component="C" />

<component_ref component="D" />

</component_ref></group>



Figure 4. The definition of the <group> in which the total_reaction component encapsulates the first_reaction, second_reaction, C, and D components.

Connections

Adding encapsulation to the two reaction model necessitates an extra layer of connections. The variables representing the input chemical species must be passed from their respective components to the total_reaction component and from the total_reaction component to the encapsulated elementary reactions (first_reaction and second_reaction). Similarly, the variables representing the changes in concentration of the chemical species must be passed from the elementary reaction components to the total_reaction component, and then from the total_reaction component to the corresponding species components. Figure 5 demonstrates this for the chemical species F, which is the final product of the overall reaction in this model.



<connection>

<map_components component_1="F" component_2="total_reaction">

<map_variables variable_1="F" variable_2="F" />

<map_variables variable_1="delta_F" variable_2="delta_F" />

</map_components>

</connection>



<connection>

<map_components component_1="total_reaction" component_2="second_reaction">

<map_variables variable_1="F" variable_2="F" />

<map_variables variable_1="delta_F" variable_2="delta_F" />

</map_components>

</connection>



Figure 5. The definition of the variable mappings between the F species component and the encapsulate second_reaction component must be passed through the total_reaction component.

The variable representing time is also defined outside of the encapsulated set of components. While the time variable can still be passed directly to the unencapsulated species components A, B, E, and F, it must be passed to the total_reaction component, and then on to the encapsulated components representing the chemical species C and D. The difference in passing the time variable to unencapsulated and encapsulated components is shown in Figure 6 using the A and D components as examples.




<connection>

<map_components component_1="environment" component_2="A">

<map_variables variable_1="time" variable_2="time" />

</map_components>

</connection>



<connection>

<map_components component_1="environment" component_2="total_reaction">

<map_variables variable_1="time" variable_2="time" />

</map_components>

</connection>



<connection>

<map_components component_1="total_reaction" component_2="D">

<map_variables variable_1="time" variable_2="time" />

</map_components>

</connection>



Figure 6. The connections mapping the time variable to the unencapsulated A component and the encapsulated D component, through the total_reaction component.

Download This Model

The CellML description of the model that this documentation discusses is available in a number of formats. If you have your browser set up to view text files served with the “text/xml” MIME type, then you can have a look at the XML file directly here. If not, you can save the target of that link to disk by shift-clicking on the preceding link. A “pretty-printed” browsable HTML version of the XML file is available here — note that you cannot download and save this version for later viewing since it makes use of stylesheets for formatting. If you wish to save or print out the “pretty-printed” version of the XML, a PDF version is also available here.

Here are those links again: