BMC Systems Biology: Version Control of Pathway Models Using XML Patches
BMC Systems Biology: Version Control of Pathway Models Using XML Patches
Abstract
Background: Computational modelling has become an important tool in understanding biological
systems such as signalling pathways. With an increase in size complexity of models comes a need
for techniques to manage model versions and their relationship to one another. Model version
control for pathway models shares some of the features of software version control but has a
number of differences that warrant a specific solution.
Results: We present a model version control method, along with a prototype implementation,
based on XML patches. We show its application to the EGF/RAS/RAF pathway.
Conclusion: Our method allows quick and convenient storage of a wide range of model variations
and enables a thorough explanation of these variations. Trying to produce these results without
such methods results in slow and cumbersome development that is prone to frustration and human
error.
Many of the differences between software and model ver- To address these differences, we have devised a flexible
sion control have at their core a difference in aims. The patch-based version control system that differs from exist-
Page 1 of 13
(page number not for citation purposes)
BMC Systems Biology 2009, 3:34 [Link]
ing software patching applications. Each patch represents • Versions proceed in a roughly linear fashion working
a modification to an existing model: an addition, deletion towards a single set of requirements. Requirements
or replacement of existing pieces. Patches can be applied may change but at any one time there is only one set.
in combination while retaining the original model struc-
ture. This allows later patches to work on the original sys- • Each new version represents an improvement over
tem, or on a configuration created with existing patches. (and usually replacement of) previous versions.
This flexible approach allows a modeller to rapidly
explore a wide variety of model configurations without • Branching does occur, but features from different
overwriting any previous ideas. We have applied the sys- branches are usually folded back into an overall 'best'
tem to models expressed in SBML [1], to take advantage of version.
the broad support for the language and the regular struc-
ture provided by XML documents. Working with XML Software version control tools, such as CVS [3], SVN [4]
models also means that our system could be easily and Git [5], are designed to support these characteristics of
extended to support other XML modelling tools, such as software development with features including distributed
CellML [2]. access and the ability to fork new versions and merge
these together.
In this paper we present details of our patch based system
along with a prototype implementation. Our method is Model Version Control
generic enough to apply to many areas of computational Although a pathway model is often a software artifact,
modelling. However, as a motivating example we have there is little published material on using version control
developed our methods in conjunction with a specific sys- systems to track model version changes. There are a
tem: the EGF pathway. We illustrate the method with ref- number of obvious distinctions between the progression
erence to the EGF pathway in a variety of versions. of a pathway model and the progression of a software
project. A characteristic progression of versions is shown
Software and Modelling Version Control in the right hand diagram of figure 1. The main features of
Software Version Control this progression are:
Software version control is a mature and established disci-
pline of software engineering. A characteristic progression • A model starts as a simple base and then a number
of versions is shown in the left hand diagram of figure 1. of possible extensions to the pathway are suggested,
The main features of this progression are: each of which are largely independent of each other.
1.0 Base
Base
2.0 +A +B +C
Page 2 of 13
(page number not for citation purposes)
BMC Systems Biology 2009, 3:34 [Link]
• Each extended version represents part of the pathway Extracellular-signal Regulated Kinase (ERK) pathway,
which is only present under certain conditions. An which is typically initiated by the activation (via ligand
extension may also represent an investigation into binding) of cell surface receptors, such as the Epidermal
whether a particular extra section of pathway is impor- Growth Factor (EGF) or Nerve Growth Factor (NGF)
tant or not. Each new version may represent the same receptors (Figure 2). In essence, there are two distinct
part of a pathway under a different hypothesis, but is pathways leading from activated receptors to ERK activa-
not necessarily an improvement or replacement for tion, the Ras pathway which proceeds via SOS-Ras-Raf1
another hypothesis. and the Rap1 pathway which proceeds via C3G-Rap1-
bRaf. Activated ERK has numerous targets in both the
• Branching generates a combinatoric effect; each new cytoplasm and nucleus, including numerous transcription
extension can be applied to all the previous combina- factors, and can therefore directly effect gene expression
tion of extensions. and influence cellular outcome. In addition, ERK is able to
phosphorylate SOS (via Rsk) thus forming a negative
It may be possible to manage such a progression using a feedback loop within the pathway [15,16].
software version control system, but it would not be a nat-
ural fit. Each combination of extensions would be One of the most common cell lines used to investigate
assigned a version number and a user would have to con- ERK signalling from growth factor receptors is the PC12
tinually track back and forth along this timeline to locate (rat pheochromocytoma) cell line. In PC12 cells, EGF
the setup they were interested in. Applying a new exten- stimulates a rapid but transient activation of ERK, peaking
sion to an existing set of combinations would require a at 5 mins and returning to basal levels at 30 mins, leading
good deal of extra work. to cellular proliferation [17,18]. In contrast, Nerve
Growth Factor stimulates a sustained activation of ERK
XML diff and patch leading to the neuronal differentiation of PC12 cells
A variety of systems already exist to record differences in [17,18]. There is now compelling evidence that the dura-
XML files and allow these changes to be duplicated. A tion of the ERK signal governs whether PC12 cells prolif-
good review of these technologies can be found in [6]. erate or withdraw from the cell cycle and differentiate into
Several algorithms [7,8] have been developed to recognise a neuronal phenotype [17,18]. Although the PC12 system
XML changes (known as a "diff") and record these has been well studied, it is still unclear how different ERK
changes. There are implementations of these techniques signal dynamics can be robustly controlled by different
from IBM [9] and others [10]. upstream receptors. Furthermore, there is a currently
some debate as to which of the two pathways (Ras and
Simulink Rap1) is utilised by the different receptors to activate ERK
Simulink is the modelling component of the mathemati- and relay their signal. Some groups have reported that
cal toolkit Matlab [11]. Simulink allows model design both EGF and NGF can only use the Ras pathway [19,20],
based on the connection of components and provides whilst others report that NGF but not EGF can also use the
integration with version control systems, so that each Rap1 pathway [21], whilst another group has reported
component can have its own version history. that both NGF and EGF can use both the Ras and Rap1
pathways [18]. Over recent years the computational mod-
Simulink is a flexible and powerful system, but the version elling of biological systems has become increasingly valu-
control mechanisms are still based on traditional software able and there are now a wide variety of models of the ERK
version control; the patch-based combinatoric modifica- pathway available which have led to some novel insights
tion of models we propose is not supported. and interesting predictions as to how this system func-
tions [22]. However, none of these studies utilised a mod-
Results ular or patch approach in their model design and analysis.
Case Study: EGF pathway This is unfortunate, given that the ERK pathway can be uti-
To demonstrate our system we have tested it on a suite of lised by different receptors with different properties, and
models based on the EGFR/MAPK system. The Mitogen that there are different pathways that can be used by
Activated Protein Kinase (MAPK) pathway is at the heart receptors to activate ERK. A patch system would enable
of a molecular signalling network that governs the one to rapidly build different versions of a receptor system
growth, proliferation, differentiation and survival of composed of different pathways and feedback loops, as
many, if not all, cell types [12-14]. It is deregulated in var- well as enabling the rapid application of the system to dif-
ious diseases ranging from cancer to immunological, ferent receptors with different properties. This would ena-
inflammatory and degenerative syndromes, and thus rep- ble one to rapidly investigate which version best reflects
resents an important drug target. Perhaps the most impor- the available biological data, which pathways (or patches)
tant and intensively studied MAPK pathway is the are critical for relaying the signal, and also enable the easy
Page 3 of 13
(page number not for citation purposes)
BMC Systems Biology 2009, 3:34 [Link]
comparison of different receptors. To demonstrate the three models included the core ERK patch (blue) and then
potential of our patch approach, we took the computa- the following model specific patches:
tional model of the ERK pathway developed by Brown et
al. (2004) [23] and split it into a number of distinct 1. Ras Model: This model included the Ras pathway
patches (Figure 2). We investigated the debate surround- patch (green) and the SOS feedback patch (orange).
ing the use of the Ras and Rap1 pathways in NGF receptor
signalling by utilising the patch approach to generate and 2. Rap1 Model: This model included the Rap1 path-
compare three different models of the receptor system. All way patch (red).
Page 4 of 13
(page number not for citation purposes)
BMC Systems Biology 2009, 3:34 [Link]
3. Ras & Rap1 Model: This model included the Ras signal switching for a transient to a sustained response.
pathway patch (green) and the SOS feedback patch Knocking out Rsk effectively knocks out the negative feed-
(orange), as well as the Rap1 pathway patch (red). back loop from ERK to SOS, which suggests that this feed-
back loop is essential for signal termination. Whilst
We first created the Ras model by using our Patch Tool to knocking out PI3K effectively knocks out the whole Akt
select our core ERK patch (blue) along with the Ras pathway, as no other species can activate Akt, which sug-
(green), and SOS feedback (orange) patches and subse- gests that the Akt pathway plays little role in either signal
quently launched and simulated the model in Copasi. We initiation or termination.
then used our Patch Tool to create the Rap1 model by
deselecting the Ras and SOS feedback patches and select- Our patch approach and tool can also be used to create
ing the Rap1 patch instead, then re-launched Copasi with patches that are mutually exclusive which is a useful fea-
the new model whilst maintaining our original simula- ture when investigating cancerous mutations. The ERK
tion and plot settings. The Ras & Rap1 model was then cre- pathway has long been associated with cancer as muta-
ated and simulated in a similar fashion. As can be seen in tions to various proteins in the pathway are well known to
Figure 3, the Ras model produces a transient active ERK result in the constitutive activation of ERK leading to
response whereas the other two models, which both uncontrolled cell growth [26-28]. For example, one of the
include the Rap1 pathway, produce a sustained active ERK most common Ras mutations is a glycine to valine muta-
response. As NGF is well known to stimulate the sustained tion at residue 12 (RasV12) which renders Ras insensitive
activation of ERK in PC12 cells, our simulation results to inactivation by Ras-GAP and thus locked in the active
suggest that the NGF receptor must signal via the Rap1 state [26]. To illustrate the potential of our patch
pathway in order to achieve this. Overall, this example approach, we constructed a cancerous Ras pathway patch
illustrates the potential of our patch approach as it ena- containing a constitutively active Ras and made it mutu-
bles one to rapidly create different versions of a system to ally exclusive with the standard Ras pathway patch. As can
investigate the role that entire pathways play in the be seen in Figure 4, swapping the standard Ras pathway
dynamics of signalling and investigate which one best patch for the cancerous Ras pathway patch results in the
reflects the available biological data. To accomplish this active ERK signal switching from a normal transient
manually can often be a tedious affair where reactions and response to a constitutively active response. This example
species are manually deleted to create new model files illustrates the potential of the patch approach in investi-
which are individually named and saved. However, if an gating the effects of diseases such as cancer where patches
error is found or an update/expansion is required, all of representing normal and mutated/modified conditions
the saved files containing the different model versions can be created. One can imagine a situation where patches
may well need to be changed, whereas with our approach representing the different cancerous mutations have been
only the corresponding patch will need to be changed generated along with patches representing the most com-
once. The close integration of our Patch Tool with the sim- mon drug treatments allowing one to test which drug/
ulation tool Copasi is also extremely useful as once combinations are the best treatments for each of the dif-
patches have been selected the model can be rapidly sim- ferent forms of cancer. To illustrate this, we created a
ulated and analysed, especially as both simulation and parameter change patch to represent a hypothetical drug
plot options are maintained as models are updated. capable of increasing the kcat value of PP2A by a factor of
10. This means that one can simply select the drug from
The patch approach can also be used to create dependent the list of parameter patches and then simulate the model
patches which are patches that can only be introduced to analyse it effects. As can be seen in Figure 5, such a drug
into a model when a specific patch is already present. This appears to be an effective treatment against cancers caused
is a useful feature when one wants to apply changes to an by RasV12.
existing patch, such as kinetic parameter changes or spe-
cies knockouts. In biological terms, such species knock- Discussion
outs could represent the available RNAi's to knockout Future Work
proteins by knocking down gene expression, enabling one Standardised Tools
to investigate which proteins play the biggest role in trans- For simplicity and convenience, our tool was based on an
ducing the signal. One interesting area of current research in-house implementation of the xml-diff techniques. How-
is focussed on how the EGF receptor system can be manip- ever, it would be good software engineering practise to base
ulated to give a sustained rather than a transient response our tool on an established XML technology such as [9].
[24,25]. Using our Patch Tool to investigate this, we cre-
ated two species knockout patches which knockout Rsk Version Control and Source Code Management
and PI3K, respectively. As can be seen in Figure 4, knock- In this paper, we are concerned specifically with version
ing out PI3K has little effect on the active ERK plot whilst control: how to allow a modeller to extend and change
knocking out Rsk has a dramatic effect with the active ERK their model and revert to previous versions if necessary.
Page 5 of 13
(page number not for citation purposes)
BMC Systems Biology 2009, 3:34 [Link]
This is distinct from source code management (SCM), The view of the authors is that an XML patching system
which provides a group of programmers with a means to should be seen as complementary to existing SCM
collaborate on a software project by managing the source approaches. XML patches make hypothesis testing and
code, although most SCM systems include a version con- combinatorial model changes far easier to manage but are
trol facility. Our work could easily be extended to encom- not a replacement for disciplined use of an SCM in a col-
pass elements of source control management. The base laborative environment.
model and patches could be uploaded into a SCM system
such as SVN, which would allow users to upload new Model Repositories
patches, amend existing patches and access the entire set The issue of model granularity also arises when deciding
of patches from a collaborative project. The difficulty with how to submit a patch-based model to a model repository,
such an approach is defining the granularity of a model such as [Link] [29]. Many patch based models will
amendment. When a change is made to a model, should not have a complete amalgamated version since removal
this be change to the base model, to one of the existing patches may remove some of this amalgamated behaviour.
patches or an entirely new patch? One possibility is to upload a number of patch combina-
Page 6 of 13
(page number not for citation purposes)
BMC Systems Biology 2009, 3:34 [Link]
tions for the model representing some more important However, we believe that the best way to drive further work
configurations. Whether this is feasible will depend on the is to be motivated by ongoing projects. We are working with
final number of important patch combinations. members of the SIMAP (Simulation modelling of the MAP
kinase pathway) project at Glasgow to develop patching
Ideally, it should be possible to upload a base model and tools specific to the modelling needs of that project to
set of patches to allow other database users the flexibility develop the patching approach as it can be most useful to
to patch and use the model as intended. In this case, a active work.
patch standard should be devised with a reference imple-
mentation to allow model databases to support patch Element Name Clashes
upload and application. This would be a more long-term Our patch system relies on unique element identifiers to
development for this work. make unambiguous references into each XML document. In
larger projects with many contributors, the patch system
Model Provenance should provide some further support to help avoid name
It might also be useful to include further methodological clashes.
provisions to document model development and prove-
nance. The plots resulting from a model run should be As a first step, the patch-set should include a name-space
stored along with the configuration of patches used to gen- summary that shows what names are present in the model
erate those plots. These model reports should be stored in and in which parts of the model, base or patches, each
a database for search and retrieval. This infrastructure name appears. The patch system should also allow anno-
would leverage the patching approach to improve the effi- tations to be added to this name-space to provide a more
ciency of model development, as described in [30,31]. detailed description of each name and how it differs from
Page 7 of 13
(page number not for citation purposes)
BMC Systems Biology 2009, 3:34 [Link]
Page 8 of 13
(page number not for citation purposes)
BMC Systems Biology 2009, 3:34 [Link]
similar names. New patches should refer to this name list of base models. Some additional information may be
and warn where name clashes exist. required to tailor the component interface to a variety of
models, but it may be possible to implement a compo-
Ideally, the names used in a model should be based on a nent approach to modelling in this way.
controlled ontology, similar to the Gene Ontology [32].
This would reduce the possibility of ambiguity to a mini- As with SBML, deeper changes may cause alterations
mum, make it clear what is referred to by each model ele- across several elements; these can be represented with a
ment and facilitate interoperability between models. combination of addition and deletion patches but may
require dependency checking not to break the application
Other SBML Features of other patches. Again, as with SBML models, deep struc-
Our case study only addresses modifications to species, tural changes might be better represented with an entirely
reaction and parameter elements. However, alterations to new model.
other SBML elements should be accommodated. For exam-
ple, introducing SBML events would be an addition patch The addition-deletion-replacement scheme might also
of the chosen events. Altering the triggers for these events work effectively to manage a set of model versions in a
would be replacement amendments for those triggers. broader environment – a Matlab model, or one written in
C++ for example. These generic models can still be repre-
In some cases, the introduction of these new elements sented as a base and a set of changes, although the imple-
may constitute a broader structural change to the model, mentation of identifying and applying changes will need
which would require treatment outside of the patch sys- to address the model representation.
tem (see below).
Conclusion
Structural Changes We have presented a version management system for
The XML patching system works well where new concep- pathway models. We have shown how using SBML docu-
tual features, such as pathway sections, are introduced and ments can allow the application of separate model
removed from a system. However, it is not so appropriate amendments in combination by using an XML patch sys-
when a model undergos a large structural change. tem. We have also presented an implementation of these
ideas and their application in a case study.
For example, if an existing model is converted to use SBML
compartments, this would mean assigning all species to a Methods
compartment, so an appropriate patch would represent the XML Patching Implementation
entire model changing. In this case, it would be easier to Our XML patching implementation is based on the Fast
start again with a fresh model of the new structure. Match Edit Script method described in [7]. We have
implemented a simplified version of this algorithm to
Once a model is built around compartments, new patch make the system more lightweight and give us fine-
sets may be needed to represent common operations on grained control over the way differences are detected and
compartment models. These could still be based on the recorded as patches.
addition, deletion and replacement amendments, but
these may need to be mixed in a single patch set. For Although the patch technology we describe here is
example, a species may be moved from one compartment generic, we have developed the system specifically for use
to another – a deletion and addition amendment in the with pathway models. During this section we will describe
same patch set. This would necessitate dependency check- how each concept applies to these models.
ing to ensure that other patches do not attempt to delete
this species after it has been moved somewhere else. Patch generation
A patch represents a change or δ between a base system B
Managing Other Model Types d
CellML is similar in structure to SBML and the addition, and a base system with a single amendment C: B → C .
deletion and replacement patch approach should be
applicable here. New CellML components can be added Patch generation is a function that takes as input a base and
using addition patches or existing ones augmented or a changed system and returns a patch δ that describes how
reduced using addition and deletion patches. The compo- to alter the base system to look like the changed system.
nent framework of CellML might allow a broader applica-
tion of the patch approach. An addition could be used to There are three types of patch that can be identified during
represent the insertion of a component and this same patch generation: addition, deletion and replacement. In
patch may be used to insert this component into a variety each case, an xpath [33] expression is used to specify
Page 9 of 13
(page number not for citation purposes)
BMC Systems Biology 2009, 3:34 [Link]
Figureversion
Model 6 control tool screenshot
Model version control tool screenshot. This figure is a typical view of our version control tool in use. The top text box
shows the base model to which the various patches can be applied. The left hand panel shows the pathways (addition patches)
available. The central panel shows knockout (deletion patches). The right hand panel shows parameter sets (change patches). A
text box at the bottom shows a Copasi file storing configuration settings for models (such as variables for plotting), which will
be applied to Copasi on choosing the 'patch and simulate' button.
whereabouts in B the change takes place. Each xpath ref- In a deletion patch, the xpath specifies the XML node to
erences the id attributes used in SBML documents to make be removed. An addition patch specifies the XML node to
sure the referenced position is unambiguous. be added at the given xpath. A replacement patch specifies
the XML node which should be used as the replacement
Some tools like Copasi produce models using anonymous for the node at the given xpath.
numbered id attributes such as 'id3'. To prevent name con-
flicts when new patches are created, we process models so A replacement patch could also be represented by a dele-
that each element take its name as the id. This method is tion and an addition, but dividing it into two patches
effective so long as the modeller does not use the same makes the function of the patch less clear and less effi-
name to model different species and is sufficient for a pro- cient. A replacement patch of the complete document
totype implementation. In larger modelling projects with would constitute a δ between B and C but would again be
many contributors, or where a model is passed from one less clear and less efficient; the xmldiff algorithm builds
modeller to another, the possibility of name clashes the smallest possible replacement patch, with the mini-
increases. This will be discussed further in the Future Work. mum patch size being one complete XML element.
Page 10 of 13
(page number not for citation purposes)
BMC Systems Biology 2009, 3:34 [Link]
XPath supports referring to specific attributes, so it would A new pathway patch may exclude another if these represent
be possible to use patches at this level of granularity. different conditions of the same pathway. For example, one
However, element level addition and replacement patches patch may represent the normal condition of this pathway
can contain complete well-formed XML to insert at this and another the cancerous condition; only one version of the
point. To implement attribute additions and replace- pathway should be applied for a particular configuration.
ments requires making a special case, since an attribute on
its own needs extra structure to become well formed XML. Patch Schema
Any attribute are still possible with element level patches An outline of the patch schema is as follows:
and can be implemented without augmenting the schema
to include special cases. • Changes Top level element. Attributes: name of
patch.
These patch operations are similar to the Delta Update
Language described in [6] but without the move operation. - Description Textual itemize of patch.
Page 11 of 13
(page number not for citation purposes)
BMC Systems Biology 2009, 3:34 [Link]
Page 12 of 13
(page number not for citation purposes)
BMC Systems Biology 2009, 3:34 [Link]
Page 13 of 13
(page number not for citation purposes)