version: 0.3.2
Matthias König, Leandro Watanabe, and Chris Myers
This document describes rules and guidelines for encoding Dynamic Flux Balance Analysis (DFBA) models in the Systems Biology Markup Language (SBML), a free and open interchange format for computer models of biological processes.
Note that these guidelines have been proposed by iBioSim or sbmlutils as ground rules for encoding and simulating DFBA models in these tools in an interchangeable and reproducible manner. It is by no means a community agreement. However, we highly encourage everyone who wants to encode DFBA models and tool developers to follow these guidelines.
The document is structured into the following sections
- Section A: describes how to encode DFBA models in SBML.
- Section B: provides information on how simulators should execute models provided in the format of Section A).
- Section C: provides answers to frequently asked questions.
DFBA Implementation based on these rules and guidelines are provided by iBioSim or sbmlutils. All supplementary information, including the latest version of this document as well as example models implementing the DFBA rules and guidelines, are provided in at https://github.com/matthiaskoenig/dfba.
The rules and guidelines for DFBA encoding were developed for models using the stationary optimization approach (SOA).
We expect readers to be familiar with the concepts of SBML and the fbc
and comp
packages and refer to the respective specifications http://sbml.org/Documents/Specifications for additional information. Also we expect readers to be familiar with the concepts of DFBA and refer to the respective literature.
The following conventions are used throughout this document:
- Required rules are stated via MUST, i.e., DFBA models in SBML must implement these rules.
- Guidelines which are recommended to be followed are indicated by SHOULD, i.e., it is good practice to follow these guidelines, but they are not required for an executable and reproducible DFBA model encoded in SBML. The provided implmentations by iBioSim and sbmlutils will run the DFBA even if these recommendations are not followed.
- Additional information for clarification is provided by CAN, i.e., it is clarified that this is allowed to remove ambiguities.
- Curly brackets, i.e,
{ }
functions as place holders which are instantiated with actual information. For instance the reaction id{rid}
means that{rid}
is replaced with the actual id of the reaction.
The following abbreviations are used in this document
- DFBA - Dynamic Flux Balance Analysis
- FBA -Flux Balance Analysis
- SBML - Systems Biology Markup Language
- SOA - Stationary optimization approach
This section describes rules and guidelines for encoding DFBA models in SBML. The proposed schema uses SBML core
, SBML comp
for model compositions, and SBML fbc
to encode FBA related information.
The core concept behind this guidelines and rules is to encode models with different modeling frameworks, i.e., kinetic models and FBA models, as well as models with different functions, i.e., updating or calculation of flux bounds within separate submodels. These submodels are connected into the overall DFBA model using hierarchical model composition based on comp
.
Two main links are required between the FBA model and the kinetic models:
- Update of flux bounds in the FBA model from the kinetic model
- Update of reaction fluxes in the kinetic model from the FBA solution
The DFBA models consists of different components performing parts of the DFBA task:
TOP
model: DFBA comp model that includes all submodels and their corresponding connections. TheTOP
model is the main SBML model, containing the other submodels. TheTOP
model encodes the kinetic model parts of the DFBA (besides bounds calculation and updates from FBA).KINETIC
submodel: kinetic part of the DFBA modelFBA
submodel: FBA part of the DFBA model. TheFBA
model defines the FBA submodel using thefbc
package.BOUNDS
submodel: calculation of the upper and lower bounds for theFBA
model. TheBOUNDS
model defines all logic for the update of the FBA bounds.UPDATE
submodel: calculation of the updatedKINETIC
part from theFBA
solution
An overview of the different submodels and their connections is provided in the following diagram:
In this subsection general rules and guidelines are defined.
[DFBA-R0001]
The DFBA model MUST be a single SBMLcomp
model.[DFBA-R0002]
The DFBA submodels MUST be encoded in the DFBA model viacomp:SubModels
.[DFBA-R0003]
The DFBA submodels MUST be defined viacomp:ExternalModelDefinitions
.[DFBA-R0004]
The DFBA model and all submodels MUST be encoded inSBML L3V1
or higher.[DFBA-R0005]
The DFBA model and all submodels MUST be valid SBML.[DFBA-R0006]
The DFBA model MUST be encoded using SBMLcore
and the SBML packagescomp
andfbc
.[DFBA-R0007]
The DFBA model MUST consist of theTOP
model and at least three submodels, the requiredFBA
,BOUNDS
andUPDATE
submodel.[DFBA-G0001]
The model and submodels SHOULD contain their respective function in themodel id
,model name
andfilename
, i.e. the stringsTOP
ortop
,FBA
orfba
,BOUNDS
orbounds
, andUPDATE
orupdate
.[DFBA-G0002]
The SBOTerms on thesubmodel
object SHOULD be identical to the SBOTerm on theModel
object of all submodels.- The
TOP
model CAN contain additional submodels. - The DFBA model and all submodels CAN have additional packages than
fbc
andcomp
.
[DFBA-R0008]
There MUST exist exactly one submodel with thefbc
package and the SBOTermSBO:0000624
(flux balance framework) on themodel
element. This model is called theFBA
submodel for theDFBA
.[DFBA-R0009]
TheFBA
submodel MUST be encoded usingfbc-v2
withstrict=true
.- There CAN be other submodels with the
fbc
package, but not with the SBOTermSBO:0000624
(flux balance framework) on the model element. These submodels CAN be eitherstrict=True
orstrict=False
.
Objects in the different submodels are linked via comp:Ports
.
[DFBA-R0010]
AllReplacedBy
andReplacements
MUST be done viaports
which are identified viaidRef
.[DFBA-R0011]
Objects which are linked via ports in the different submodels MUST have identical ids in the the different submodels.[DFBA-R0012]
In addition, the respective ports of the linked objects MUST have the same ids.[DFBA-G0003]
AllPorts
SHOULD have the id{idRef}_port
for an object withidRef={idRef}
.
[DFBA-G0004]
All models SHOULD contain units.[DFBA-G0005]
The units of the submodel SHOULD be identical and be replaced by the top model.
In this subsection the rules and guidelines for the TOP
model are defined.
[TOP-R0001]
TheTOP
model MUST have the SBOTermSBO:0000293
(non-spatial continuous framework) on theModel
element.[TOP-R0002]
TheTOP
model MUST have exactly one submodel with the SBOTermSBO:0000624
(flux balance framework) on theModel
element.
[TOP-R0003]
TheTOP
DFBA model MUST contain a parameterdt
which defines the step size of the FBA optimizations, i.e. after which time interval the FBA is performed.[TOP-R0004]
Thedt
parameter MUST be annotated with the SBOTermSBO:0000346
(temporal measure).[TOP-R0021]
Thedt
Parameter MUST be constant.[TOP-R0005]
If thedt
parameter hasunits
, than they MUST be identical to thetimeUnits
of the model.
Dummy species are required for the definition of dummy reactions in SBML L3V1, because every reaction requires at least one reactant or product (the following rules can be relaxed in SBML L3V2).
[TOP-R0006]
The top model MUST have a dummy species withid="dummy_S"
.[TOP-R0007]
For every exchange reaction in theFBA
submodel, there MUST exist a dummy exchange reaction in theTOP
model.[TOP-R0008]
Each dummy exchange reaction MUST include the dummy speciesdummy_S
as product with stochiometry1.0
.[TOP-R0009]
The dummy exchange reaction MUST NOT have any other reactants, products or modifiers thandummy_S
, i.e.-> dummy_S
[TOP-G0001]
The id of the dummy reaction SHOULD be identical to the respective exchange reaction, i.e.id="{rid}"
for the exchange reaction withid="{rid}"
in theFBA
submodel.[TOP-G0002]
The dummy species SHOULD NOT have andcompartment
set.[TOP-G0003]
The dummy species SHOULD have the SBOTermSBO:0000291
(empty set).[TOP-G0004]
The dummy reactions SHOULD have the SBOTermSBO:0000631
(pseudoreaction).[TOP-G0005]
The dummy species CAN be in an arbitrarycompartment
of theTOP
model.
[TOP-R0010]
TheTOP
model MUST contain a species for every species which has an exchange reaction in theFBA
model (exchangespecies
).[TOP-R0011]
The exchangespecies
MUST replace the corresponding species in theUPDATE
andBOUNDS
model viaReplacedElements
.
[TOP-R0012]
For every dummyReaction
in theTOP
model, a corresponding fluxParameter
MUST exist in theTOP
model which isconstant=true
with the id{pid}
.[TOP-R0013]
For every dummy exchangeReaction
withid={rid}
and corresponding fluxParameter
withid={pid}
in the top model anAssignmentRule
in theTOP
model MUST exist of the form{pid} = {rid}
.[TOP-G0005]
The flux parameter SHOULD have the idp{rid}
for the corresponding dummy reaction{dummy_rid}
, e.g.pEX_Glc
forEX_Glc
.[TOP-G0006]
The fluxParameters
SHOULD have the SBOTermSBO:0000612
(rate of reaction).[TOP-G0007]
The fluxAssignmentRules
SHOULD have the SBOTermSBO:0000391
(steady state expression).
[TOP-R0014]
Every dummy reaction in theTOP
model withid="dummy_{rid}"
MUST be replaced via acomp:ReplacedBy
with the corresponding exchange reaction withid={EX_rid}
from theFBA
submodel. Thecomp:ReplacedBy
uses theportRef
of the exchange reaction{EX_rid}_port
.
These replacements update the ODE fluxes in the TOP
model by replacing the dummy Reaction
by the corresponding FBA
reaction.
[TOP-R0015]
For every parameter that is used as a flux bound, other than default ones, for a reaction in theFBA
submodel, there MUST be a replacing parameter in theTOP
model.[TOP-R0016]
For thedt
parameter in theBOUNDS
model there must be a replacement with theTOP
dt
parameter.[TOP-R0017]
For every species that is used for bounds calculation in theBOUNDS
model (this includes all exchange species) there MUST exist a replacement species in theTOP
model.[TOP-R0018]
For every species that is updated in theUPDATE
models there MUST exist a replacement species in theTOP
model.[TOP-R0019]
TODO:
For every uper and lower bound parameter ... (exchange reactions & kinetic reactions)[TOP-G0008]
The replaced species in theBOUNDS
andUPDATE
submodels SHOULD be connected via the same replacing species in theTOP
model.
In this subsection the rules and guidelines for the FBA
model are defined. The FBA
model defines the FBA submodel using the fbc
package.
[FBA-R0001]
TheModel
element of theFBA
submodel MUST have the SBOTermSBO:0000624
(flux balance framework) on theModel
element.[FBA-R0002]
TheFBA
model MUST be encoded using the SBML packagefbc-v2
withstrict=true
.[FBA-R0003]
Thereactions
in the FBA model MUST NOT have anyKineticLaw
.
[FBA-R0004]
TheFBA
model MUST contain at least one objective function. Objective functions CAN bemaximize
orminimize
.[FBA-R0005]
The objective function for the DFBA model MUST be the active objective in theFBA
model.
Unbalanced species in the FBA
model correspond to species in the kinetic model which are changed via the FBA fluxes. Unbalanced species are encoded by the means of exchange reactions.
[FBA-R0006]
Unbalancedspecies
in the FBA MUST be encoded by creating an exchange reaction for the respective species.[FBA-R0007]
The exchangeReactions
MUST have theSpecies
which is changed by the reaction (unbalancedSpecies
in FBA) as substrate with stoichiometry1.0
and have no products, i.e. have the form1.0 {sid} ->
with{sid}
being theSpecies
id.[FBA-G0001]
The exchangeReactions
SHOULD have the SBOtermSBO:0000627
(exchange reaction).[FBA-G0002]
The exchangeReactions
SHOULD be namedEX_{sid}
, i.e. consist of the prefixEX_
and theSpecies
id{sid}
.[FBA-G0003]
Exchange reactions SHOULD NOT have acompartment
.
[FBA-R0009]
AllSpecies
in the FBA model MUST haveboundaryCondition=False
.
[FBA-R0010]
All exchange reactions MUST have individualParameters
for the upper and lower bound which are not used by other reactions (unless using default bounds).[FBA-G0004]
TheParameters
for the upper and lower bounds of reactions SHOULD have the idsub_{rid}
andlb_{rid}
with{rid}
being the respective reaction id.[FBA-G0005]
TheParameters
describing the flux bounds SHOULD have the SBOTermSBO:0000625
(flux bound).
[FBA-R0011]
All exchange reactions MUST have a port.[FBA-R0012]
All upper and lower bounds of exchange reactions MUST have a port.
In this subsection the rules and guidelines for the BOUNDS
model are defined.
The BOUNDS
submodel calculates the upper and lower bounds for the FBA
model. For this calculation the Species
changed via exchange Reactions
in the FBA and the time step dt
are required.
The parameter dt
is used in calculating the upper and lower bounds based on the availability of the species in the exchange Reactions
. This ensures that the FBA solution cannot take more than the available species amounts in the time step of duration dt
and is consistent for the time step with the available resources.
[BND-R0001]
TheBOUNDS
model MUST have the SBOTermSBO:0000293
(non-spatial continuous framework) on theModel
element.
[BND-R0002]
TheBOUNDS
model MUST contain the parameterdt
which defines the step size of the FBA optimizations.[BND-R0016]
Thedt
Parameter MUST be constant.[BND-R0004]
Thedt
parameter MUST be annotated with the SBOTermSBO:0000346
(temporal measure).
[BND-R0005]
TheBOUNDS
submodel MUST contain all exchangeSpecies
, i.e.Species
which are reactants inFBA
exchangeReactions
.[BND-R0006]
TheBOUNDS
submodel MUST contain allCompartments
which are used in exchangeSpecies
.[BND-R0007]
TheBOUNDS
model MUST containParameters
for all upper and lower flux bounds of exchangeReactions
.[BND-R0008]
TheBOUNDS
model MUST containFunctionDefinitions
formin
andmax
of the form
min=lambda( x,y, piecewise(x,lt(x,y),y) )
and
max=lambda( x,y, piecewise(x,gt(x,y),y) )
.[BND-R0009]
TheBOUNDS
model MUST containAssignmentRules
for the update of lower bounds of the exchange reactions of the formlb_EX_{sid}=max(lb_default, -{sid}*{cid}/dt)
with{cid}
being the compartment of the species{sid}
. This ensures that in the time stepdt
not more than the available amounts of the species are used in theFBA
solution.[BND-R0010]
If there are additional kinetic lower bounds on the exchange reactions these kinetic bounds MUST be used for restricting the bounds vialb_EX_{sid}=max(lb_kinetic, -{sid}*{cid}/dt)
[BND-R0011]
TheBOUNDS
model MUST contain the necessary parameter and assignment rules for the update of additional upper and lower bounds of reactions in the FBA which are not exchange reactions. E.g. if there is a time dependent change in an upper bound of an FBA reaction this belongs in theBOUNDS
model.[BND-G0001]
TheParameters
describing the flux bounds SHOULD have the SBOTermSBO:0000625
(flux bound).- The
BOUNDS
submodel CAN calculate additional kinetic bounds for exchange reactions viaAssignmentRules
,RateRules
orEventAssignments
.
[BND-R0003]
Thedt
Parameter
MUST have aPort
.[BND-R0012]
All boundSpecies
used in theBOUNDS
model MUST have aPort
.[BND-R0013]
AllCompartments
of boundSpecies
MUST have aPort
.[BND-R0014]
All upper and lower bounds of exchange reactions MUST have aPort
.[BND-R0015]
All additional kinetic bounds parameter changed in theBOUNDS
model MUST have aPort
.
[BND-R0016]
TheTOP
model MUST contain parameters withReplacedElements
for all upper and lower bounds which are changed via theBOUNDS
submodel.
In this subsection the rules and guidelines for the UPDATE
model are defined. The update submodel performs the update of the species which are changed by the FBA
, i.e. the species which have exchange reactions.
[UPD-R0001]
TheUPDATE
model MUST have the SBOTermSBO:0000293
(non-spatial continuous framework) on theModel
element.[UPD-R0002]
TheUPDATE
model MUST contain corresponding dynamicSpecies
for allSpecies
which are reactants inFBA
exchangeReactions
.[UPD-R0003]
TheUPDATE
model MUST contain correspondingcompartments
for allSpecies
which are reactants inFBA
exchangeReactions
.[UPD-G0001]
The species in theUPDATE
submodel SHOULD have identical ids to the species in theFBA
submodel.
[UPD-R0004]
For everyFBA
exchange reaction with id{rid}
theUPDATE
model MUST contain a respective flux parameter with id{pid}
.[UPD-R0005]
The every flux parameter in theUPDATE
submodel theTOP
model MUST have a corresponding flux parameter with areplacedElement
for the flux parameter in theUPDATE
model.[UPD-R0006]
For everyFBA
exchangeReaction
theUPDATE
model MUST contain an updatereaction
with identical reaction equation than the corresponding exchange reaction, i.e.S ->
.[UPD-R0007]
The update reaction MUST have aKineticLaw
which depends on the flux parameter{pid_S}
f(pid_S)
for theSpecies
S being updated. In the simplest case the update is performed viaupdate_S = -pid_S
i.e., the resulting change in Species via the update reaction is thandS/dt = -pid_S
.[UPD-G0002]
The update reactions SHOULD have the SBOTermSBO:0000631
(pseudoreaction).[UPD-G0003]
The flux parameters SHOULD have the SBOTermSBO:0000613
(reaction parameter).[UPD-G0004]
The update reactions SHOULD have noCompartment
set.[UPD-G0005]
The updateReactions
SHOULD have ids of the formupdate_{sid}
with{sid}
being the id of theSpecies
which is updated.[UPD-G0006]
The fluxParameters
in theUPDATE
model SHOULD have identical ids to the flux parameters in the top model.
[UPD-R0008]
AllSpecies
used in theUPDATE
model MUST have a port.[UPD-R0009]
AllCompartments
of boundSpecies
MUST have a port.[UPD-R0010]
All fluxParameters
MUST have a port.
DFBA models SHOULD be exchanged as COMBINE archives containing all SBML submodels. A simulation experiment description for the DFBA simulation SHOULD be provdided in (SED-ML) in the COMBINE archive demonstrating core behavior of the DFBA model, i.e., simple timecourse simulations. In the SED-ML the simulation algorithm MUST be provided with the simulation algorithm being from the subset of KISAO terms
- KISAO:0000499 dynamic flux balance analysis (DFBA)
- KISAO:0000500 static optimization approach dynamic flux balance analysis (SOA-DFBA)
The examples and implementations are all based on the static optimization approach (SOA-DFBA).
In this section we describe how models in the DFBA SBML formalism described in section A should be simulated by software. The described simulation and update strategy was implemented in two DFBA simulators: iBioSim and sbmlutils.
The DFBA models are solved via a Static Optimization Approach (SOA). The total simulation time is divided into time intervals of length dt
with the instantaneous optimization (FBA) solved at the beginning of every time interval. The dynamic equations are than integrated over the time interval assuming that the fluxes are constant over the interval.
Before every optimization of the FBA part optimization constraints have to be updated from the dynamic part, after every optimization the dynamic variables corresponding to the FBA fluxes have to be updated.
The simulation algorithm starts off by computing the reaction fluxes in the FBA submodel. The reaction fluxes updates the reaction values in the TOP model, which are used to compute the reaction rates in the UPDATE submodel. Once the reaction fluxes are computed by FBA, all NON-FBA submodels are updated concurrently.
time = 0
# calculate initial flux bounds
calculate_initial_state()
while (time <= tend){
# FBA
set_bounds_fba()
v_optimal = optimize_fba()
# ODE
update_fluxes_ode(v_optimal)
integrate_ode(start=time, end=time+dt, steps=1)
# next time step
time = time + dt
}
- The output time points MUST be in agreement with the
dt
parameter, i.e. the interval between subsequent time points MUST bedt
. This does not affect the internal steps of the kinetic solver. - The model simulation MUST abort if the FBA LP probelm is infeasible.
- If the kinetic simulation encounters problems like unfulfilled tolerances the simulation MUST stop.
- The flux bounds MUST be updated from the kinetic model before the FBA optimization is run.
- The fluxes in the kinetic model MUST be set before the kinetic simulation is run.
- For the execution of the kinetic models the comp model is flattend and the flattened model is simulated.
- For the FBA optimization the
reversible
attribute ofReactions
does not influence the fba solution, Only the upper and lower bounds restrict the possible direction of flux for a reaction. - The FBA optimization is performed using pFBA (parsimonous FBA) resulting in a Flux distribution with minimal total flux.
For the DFBA simulation absolute tolerances absTol
and relTol
are defined. These tolerances are used for the kinetic integration.
In addition absTol
is used in the update of the bounds. If the updated bounds are smaller than the absolute tolerance the bounds are set to zero (this avoids infeasible LP problems due to very small negative upper bounds or positive lower bounds).
if abs(bound_updated)<= absTol:
bound_updated = 0
Yes, multiple kinetic submodels can exist in the DFBA. During the kinetic integrations the flattend kinetic model is integrated. However, kinetic submodels SHOULD be kept inside the KINETIC submodel.
No, in the first version only a single FBA submodel is allowed.
No, in the first version of the DFBA guidelines and implementation only deterministic kinetic models can be coupled to FBA models. In future versions the coupling of stochastic and/or logical models can be supported.
It is possible to encode SBML models with additional modeling frameworks than FBA or deterministic ODE models. Examples are logical models encoded with the SBML package qual
or stochastic models, i.e. stochastic ODE models. Such models will be considered in future versions.
No, currently only fixed step sizes are supported. The simulation steps must be in agreement with the dt
parameter for bound updates.
Currently, in iBioSim
and sbmlutils
all SBML core constructs are supported in the kinetic models with the exception of Delay
and AlgebraicRule
.
You can make suggestions on the Github Issue Tracker. Note this does not guarantee that your suggestions will be adopted. However, we welcome good ideas that would improve our proposed data model idea.
FBA models containing species with boundaryCondition=True
can easily be converted in supported FBA
models by setting boundaryCondition=False
and adding a exchange Reaction
for the corresponding Species
.