synbiopython.genbabel.sbmlgen¶
Synbiopython (c) Global BioFoundry Alliance 2020
Synbiopython is licensed under the MIT License.
This module is to create SBML file for ODE model using simplesbml package, which relies on libSBML.
- Reference:
-
class
synbiopython.genbabel.sbmlgen.SBMLgen.
SBMLgen
[source]¶ Bases:
object
Class to generate SBML file for ODE model.
-
static
export_sbml
(ODE, Variable, Init, ParamName, Param, ParamUnit, **kwargs)[source]¶ Function to generate the SBML xml file.
- Parameters
ODE (list) – The ODEs in the form of string stored in a list
Variable (list) – The names of variable in a list of string
Init (list) – Initial conditions for the variables in a list of values
ParamName (list) – The names of the parameters stored in a list
Param (list) – The parameters values
ParamUnit (list) – The unit for the parameter according to available unit definition
- Returns
SBML in str
- Return type
str
-
static
This module is the simplesbml package from https://simplesbml.readthedocs.io/en/latest/ with minor modifications to include more unit definitions
-
class
synbiopython.genbabel.sbmlgen.simplesbml.
sbmlModel
(time_units='second', extent_units='mole', sub_units='mole', level=3, version=1)[source]¶ Bases:
object
Class to generate sbml model file using libsbml method.
-
addAssignmentRule
(var, math)[source]¶ To assign a state variable with an expression.
- Parameters
var (str) – id of the state variable
math (str) – expression in str
-
addCompartment
(vol=1, comp_id='')[source]¶ Create compartment of volume litres to the model.
- Parameters
vol (float) – volume of compartment in L
comp_id (str) – compartment id
-
addEvent
(trigger, assignments, persistent=True, initial_value=False, priority=0, delay=0, event_id='')[source]¶ Add event supplied with when an event is triggered and what happens using assignments in a dictionary.
- Parameters
trigger (str) – define when an event is triggered (logical expression)
assignments (dict) – keys are the variables to be modified and the values are the new values
persistent (boolean) – determine if the event will still be executed if trigger turns from True to False
initial_value (boolean) – value of trigger before t=0
priority (float) – determine which event is executed, event with larger priority is executed
delay (float) – time between when the event is triggered and the assignment is implemented
event_id (str) – id of the event
-
addInitialAssignment
(symbol, math)[source]¶ Describe the initial value of the variable in terms of other variables or parameters.
- Parameters
symbol (str) – id of the variable
math (str) – expression
-
addParameter
(param_id, val, units='per_second')[source]¶ Add Parameter with value and unit.
- Parameters
param_id (str) – parameter id/name
val (float) – value for the parameter
units (str) – unit for the parameter
-
addRateRule
(var, math, rr_id='')[source]¶ Describe the derivative of the state variable wrt time as an expression.
- Parameters
var (str) – id of the state variable
math (str) – expression in str
rr_id (str, optional) – id for the reaction rate
-
addReaction
(reactants, products, expression, local_params=None, rxn_id='')[source]¶ Create reaction provided with reactants and products in lists
- Parameters
reactants (list) – list of species id for reactants
products (list) – list of species id for products
expression (str) – reaction rate expression
local_params (dict) – keys are the param id and values are their respective values
rxn_id (str, optional) – id for the reaction
-
addSpecies
(species_id, amt, comp='c1')[source]¶ Create Species with the provided amount.
- Parameters
species_id (str) – id or name of the species.
amt (float) – initial amount.
comp (str) – compartment id
-
-
synbiopython.genbabel.sbmlgen.simplesbml.
writeCode
(doc)[source]¶ Return string containing calls to functions that reproduce the model in SBML doc.