dfba

Create top level imports.

Subpackages

Submodules

Package Contents

Classes

ControlParameter

Holds information regarding a control parameter in a DfbaModel object.

ExchangeFlux

Class for holding information for an exchange flux in a DfbaModel object.

KineticVariable

Class for holding information for a kinetic variable in a DfbaModel object.

DfbaModel

Class representation for a dynamic FBA model.

Functions

get_versions()

Get version information or return default if unable to do so.

show_versions() → None

Print dependency information.

Attributes

__author__

__email__

__version__

dfba.__author__ = Multiline-String[source]
Show Value
1David S. Tourigny, Columbia University Irving Medical Center, New York, USA
2Moritz E. Beber, Novo Nordisk Foundation Center for Biocustainability, Technical University of Denmark
dfba.__email__ = Multiline-String[source]
Show Value
1dst2156@cumc.columbia.edu
2morbeb@biosustain.dtu.dk
dfba.get_versions()[source]

Get version information or return default if unable to do so.

dfba.__version__[source]
dfba.show_versions()None[source]

Print dependency information.

class dfba.ControlParameter(name: str, change_point: str = None, values: List = None, change_points: List = None, *args, **kwargs)[source]

Bases: optlang.symbolics.Symbol

Holds information regarding a control parameter in a DfbaModel object.

id

The identifier to associate with this control parameter.

Type

string

change_points

The time points at which this control parameter changes value.

Type

list

values

The values taken by this control parameter.

Type

list

property id(self)str

For convenience, synonym with .name from symbolics.Symbol.

property change_points(self)List

Time points at which this control parameter changes value.

property values(self)List

Actual values of the control parameter.

set_parameters(self, change_points: List, values: List)None

Standardize input attributes.

class dfba.ExchangeFlux(name: str, *args, **kwargs)[source]

Bases: optlang.symbolics.Symbol

Class for holding information for an exchange flux in a DfbaModel object.

id

The identifier to associate with this exchange flux.

Type

string

lower_bound_expression

The symbolic expression for calculating the lower bound of this exchange flux.

Type

optlang.symbolics expression

upper_bound_expression

The Symbolic expression for calculating the upper bound of this exchange flux.

Type

optlang.symbolics expression

property id(self)str

For convenience, synonym with .name from symbolics.Symbol.

property lower_bound_expression(self)dfba.types.Expression

Relate the exchange rate to some symbolic expression.

property upper_bound_expression(self)dfba.types.Expression

Relate the exchange rate to some symbolic expression.

class dfba.KineticVariable(name: str, initial_condition: numbers.Number = 0.0, *args, **kwargs)[source]

Bases: optlang.symbolics.Symbol

Class for holding information for a kinetic variable in a DfbaModel object.

id

The identifier to associate with this kinetic variable.

Type

string

rhs_expression

The symbolic expression for calculating derivative of this kinetic variable wrt time.

Type

optlang.symbolics expression

initital_condition

The initial value of this kinetic variable to be used at start of simulation.

Type

int or float

property id(self)str

For convenience, synonym with .name from symbolics.Symbol.

property rhs_expression(self)Union[dfba.types.Expression, None]

Relate the rhs expression to some symbolic expression.

property initial_condition(self)numbers.Number

Relate the ininital condition to some int or float value.

class dfba.DfbaModel(cobra_object: cobra.Model)[source]

Bases: cobra.Object

Class representation for a dynamic FBA model.

Parameters

cobra_object (cobra.Model) – Existing cobra.Model object representing FBA model.

cobra_model

Existing cobra.Model object containing FBA model (reactions, metabolites, objective).

Type

cobra.Model

reactions

A DictList object where the key is the reaction identifier and the value a cobra.Reaction object in cobra_model attribute.

Type

DictList

objectives

A list containing identifiers of reactions to be used as objectives in lexicographic optimization (currently not supported)

Type

list

directions

A list containing directions (max or min) of each objective in lexicographic optimization (currently not supported)

Type

list

kinetic_variables

A DictList object where the key is the kinetic variable identifier and the value a KineticVariable object.

Type

DictList

exchange_fluxes

A DictList object where the key is the reaction identifier and the value an ExchangeFlux object.

Type

DictList

user_data

A read only attribute containing user data of the model to be passed to algorithm prior to simulation.

Type

dfba_utils.UserData

solver_data

An attribute containing data for the solver to be used for simulation of the model.

Type

dfba_utils.SolverData

add_objectives(self, objectives: List, directions: List)None

Add objectives.

Parameters
  • objectives (list) – The list of reaction indetifiers to be added to the model as objectives for lexicographic optimization.

  • directions (list) – The list of directions (max or min) of each objective to be added to the model for lexicographic optimization.

add_kinetic_variables(self, kinetic_variable_list: List)None

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)None

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)None

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: dfba.types.Expression, control_parameters: Optional[List[dfba.control.ControlParameter]] = None)None

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: dfba.types.Expression, condition: Optional[dfba.types.Expression] = None, control_parameters: Optional[List[dfba.control.ControlParameter]] = None)None

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: dfba.types.Expression, condition: Optional[dfba.types.Expression] = None, control_parameters: Optional[List[dfba.control.ControlParameter]] = None)None

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)Tuple[pandas.DataFrame, pandas.DataFrame]

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

  1. time, concentrations (in self.kinetic_variables)

  2. time, flux trajectories (in )

Return type

tuple of 2 pd.Dataframe’s

lp_problem(self)dfba.types.Problem

LP problem.

Returns

lp_problem – SWIGLPK object representing FBA model as pointer to GLPK problem

Return type

Swig Object of type glp_prob *

property id(self)str

.

property cobra_model(self)cobra.Model

.

property reactions(self)cobra.DictList

.

property objectives(self)List

.

property directions(self)List

.

property kinetic_variables(self)cobra.DictList

.

property exchange_fluxes(self)cobra.DictList

.

property user_data(self)UserData

.

property solver_data(self)SolverData

.

add_to_library(self, tstart: float, tstop: float, tout: float, print_fluxes: List[cobra.Reaction], directory: str)None

Add model to library.

Parameters ——- tstart : float

Initial time point to be used in simulation of the model.

tstopfloat

Final time point to be used in simulation of the model.

toutfloat

Length of time interval for output.

print_fluxeslist

List of reactions whose fluxes are to be printed to results along with kinetic variables.

directory: string

Path to temporary directory containing library.