dfba.model¶
Definition of DfbaModel class.
Module Contents¶
Classes¶
DfbaModel(cobra_object: Model) |
Class representation for a dynamic FBA model. |
-
class
dfba.model.DfbaModel(cobra_object: Model)[source]¶ Bases:
cobra.ObjectClass representation for a dynamic FBA model.
Parameters: cobra_object (cobra.Model) – Existing cobra.Model object representing FBA model. -
cobra_model[source]¶ Existing cobra.Model object containing FBA model (reactions, metabolites, objective).
Type: cobra.Model
-
reactions[source]¶ A DictList object where the key is the reaction identifier and the value a cobra.Reaction object in cobra_model attribute.
Type: DictList
-
objectives[source]¶ A list containing identifiers of reactions to be used as objectives in lexicographic optimization (currently not supported)
Type: list
-
directions[source]¶ A list containing directions (max or min) of each objective in lexicographic optimization (currently not supported)
Type: list
-
kinetic_variables[source]¶ A DictList object where the key is the kinetic variable identifier and the value a KineticVariable object.
Type: DictList
-
exchange_fluxes[source]¶ A DictList object where the key is the reaction identifier and the value an ExchangeFlux object.
Type: DictList
-
user_data[source]¶ A read only attribute containing user data of the model to be passed to algorithm prior to simulation.
Type: dfba_utils.UserData
-
solver_data[source]¶ An attribute containing data for the solver to be used for simulation of the model.
Type: dfba_utils.SolverData
-
cobra_model:Model[source] .
-
reactions:DictList[source] .
-
objectives:List[source] .
-
directions:List[source] .
-
kinetic_variables:DictList[source] .
-
exchange_fluxes:DictList[source] .
-
user_data:UserData[source] .
-
solver_data:SolverData[source] .
-
add_kinetic_variables(self, kinetic_variable_list: List)[source]¶ Add kinetic variables.
Parameters: kinetic_variable_list (list) – The list of indetifiers of kinetic variables to be added to the model.
-
add_exchange_fluxes(self, exchange_flux_list: List)[source]¶ Add exchange fluxes.
Parameters: exchange_flux_list (list) – list of identifiers of exchange fluxes to be added to the model.
-
add_initial_conditions(self, initial_conditions: Dict)[source]¶ Add initial conditions.
Parameters: initial_conditions (dict) – A dict where the key is the kinetic variable identifier and the value an initial condition.
-
add_rhs_expression(self, kinetic_variable_id: str, expression: Expression, control_parameters: Optional[List[ControlParameter]] = None)[source]¶ Add rhs expression.
Parameters: - kinetic_variable_id (string) – Identifier of the kinetic variable to be supplied with rhs expression for calculating its derivative wrt time.
- expression (optlang.symbolics expression) – The symbolic expression for calculating derivative of kinetic variable wrt time.
- control_parameters (list) – A list of ControlParameter objects (if any) appearing in the supplied symbolic expression.
-
add_exchange_flux_lb(self, exchange_flux_id: str, expression: Expression, condition: Optional[Expression] = None, control_parameters: Optional[List[ControlParameter]] = None)[source]¶ Add exchange flux lower bound.
Parameters: - exchange_flux_id (string) – Indetifier of the exchange flux to be supplied with expression for calculating its lower bound.
- expression (optlang.symbolics expression) – The symbolic expression for calculating lower bound of exchange flux. Convention is that lower bounds of exchange fluxes come with negative sign and therefore expression should be non-negative,representing the magnitude of this lower bound.
- condition (optlang.symbolics expression) – The symbolic expression for non-negative condition on metabolite concentrations required for correct evaluation of lower bound expression. Numerical approximation can generate unphysical, negative concetration values.
- control_parameters (list) – A list of ControlParameter objects (if any) appearing in the supplied symbolic expression.
-
add_exchange_flux_ub(self, exchange_flux_id: str, expression: Expression, condition: Optional[Expression] = None, control_parameters: Optional[List[ControlParameter]] = None)[source]¶ Add exchange flux upper bound.
Parameters: - exchange_flux_id (string) – Indetifier of the exchange flux to be supplied with expression for calculating its upper bound.
- expression (optlang.symbolics expression) – The symbolic expression for calculating upper bound of exchange flux. Convention is that upper bounds of exchange fluxes come with positive sign and therefore expression should be non-negative, representing the magnitude of this upper bound.
- condition (optlang.symbolics expression) – The symbolic expression for non-negative condition on metabolite concentrations required for correct evaluation of upper bound expression. Numerical approximation can generate unphysical, negative concetration values.
- control_parameters (list) – A list of ControlParameter objects (if any) appearing in the supplied symbolic expression.
-
simulate(self, tstart: float, tstop: float, tout: float, output_fluxes: Optional[List[str]] = None)[source]¶ Simulate model.
Parameters: - tstart (float) – Initial time point to be used in simulation of the model.
- tstop (float) – Final time point to be used in simulation of the model.
- tout (float) – Output frequency to be used in simulation of the model.
- output_fluxes (list) – Optional list of reaction ids whose fluxes are to be printed to results along with kinetic variables.
Returns: - time, concentrations (in self.kinetic_variables)
- time, flux trajectories (in )
Return type: tuple of 2 pd.Dataframe’s
-
lp_problem(self)[source]¶ LP problem.
Returns: lp_problem – SWIGLPK object representing FBA model as pointer to GLPK problem Return type: Swig Object of type glp_prob *
-
add_to_library(self, tstart: float, tstop: float, tout: float, print_fluxes: List[Reaction], directory: str)[source]¶ Add model to library.
Parameters ——- tstart : float
Initial time point to be used in simulation of the model.- tstop : float
- Final time point to be used in simulation of the model.
- tout : float
- Length of time interval for output.
- print_fluxes : list
- List of reactions whose fluxes are to be printed to results along with kinetic variables.
- directory: string
- Path to temporary directory containing library.
-