In CNApy you can define a scenario under which metabolic analyses like the FBA will be performed. In its most basic form, a scenario is a set of flux bounds for a set of reactions. A scenario flux can fix the flux of a reaction or set a lower and upper bound for the flux. Furthermore, a scenario can contain its own objective function and it is possible to add reactions as well as constraints over the reaction fluxes to a model.
The scenario fluxes of regular model reactions can be edited via the reaction boxes on the map or the Scenario column of the reaction list.
Accepted values are either a single float like 1.5
or a pair of floats like -10, 1.2
.
A single float fixes the flux of the reaction to this value (1.5
) while a pair sets the lower flux bound of the reaction to the first value (-10
) and the upper flux bound to the second value (1.2
).
Note that in a scenario you can use values outside the defined lower/upper bound of a reaction. In such a case the scenario will supersede the reaction bounds which allows temporary modification of the bounds without the need to change the model.
Reactions boxes with scenario flux are marked by the scenario color and a green frame. The frame turns yellow, if the scenario flux lies outside the reaction bounds of the model.
To remove a scenario flux, simply delete the scenario value in the reaction box or "Scenario" column of the reaction list.
A scenario objective can be defined in the Scenario tab. There it is also possible to select whether the scenario objective or the model objective is to be used (e.g. in FBA).
Scenario reactions can be added via the scenario tab. All metabolites from the model can be used when entering a reaction equation. If you use a metabolite that is not part of the model it will automatically be added to the model whenever the scenario is applied (e.g. in FBA). Scenario reactions are intended as a means for introducing a few reactions that are necessary for a scenario's function without having to modify the model. Note that is not possible to set further properties of scenario reactions (e.g. a gene rule) or metabolites (e.g. a formula). If this is required then you need to add the respective reaction or metabolite to the model itself.
These are linear (in-)equality constraints over the reaction fluxes in the network (model as well as scenario reactions). Such a constraint can for instance be used to express a minimal product yield that is required in the scenario.
You can save and load scenarios as *.scen
files via the Scenario menu or the toolbar. If a scenario file has been loaded its name is shown in the toolbar.
The flux bounds of a scenario can be set as the default scenario of your project.
This can be done via set current scenario as default scenario in the Scenario menu.
The project must then be saved, and the next time you open the project the scenario is already set.
CNApy implements an edit history for the scenario fluxes and with the tool buttons you can undo/redo your changes. Note that the edit history is for scenario fluxes only, scenario reactions and constraints can only be added/removed via the Scenario tab. You can also import all the values that are currently in the reaction boxes into the scenario (can be useful for applying a MCS), and you can change the model's reaction bounds to the current scenario flux values.