:mod:`dfba`
===========
.. py:module:: dfba
.. autoapi-nested-parse::
Create top level imports.
Subpackages
-----------
.. toctree::
:titlesonly:
:maxdepth: 3
plot/index.rst
Submodules
----------
.. toctree::
:titlesonly:
:maxdepth: 1
_version/index.rst
control/index.rst
exchange/index.rst
helpers/index.rst
jit/index.rst
library/index.rst
model/index.rst
types/index.rst
variable/index.rst
Package Contents
----------------
Classes
~~~~~~~
.. autoapisummary::
dfba.ControlParameter
dfba.ExchangeFlux
dfba.KineticVariable
dfba.DfbaModel
Functions
~~~~~~~~~
.. autoapisummary::
dfba.get_versions
dfba.show_versions
Attributes
~~~~~~~~~~
.. autoapisummary::
dfba.__author__
dfba.__email__
dfba.__version__
.. data:: __author__
:annotation: = Multiline-String
.. raw:: html
Show Value
.. code-block:: text
:linenos:
David S. Tourigny, Columbia University Irving Medical Center, New York, USA
Moritz E. Beber, Novo Nordisk Foundation Center for Biocustainability, Technical University of Denmark
.. raw:: html
.. data:: __email__
:annotation: = Multiline-String
.. raw:: html
Show Value
.. code-block:: text
:linenos:
dst2156@cumc.columbia.edu
morbeb@biosustain.dtu.dk
.. raw:: html
.. function:: get_versions()
Get version information or return default if unable to do so.
.. data:: __version__
.. function:: show_versions() -> None
Print dependency information.
.. class:: ControlParameter(name: str, change_point: str = None, values: List = None, change_points: List = None, *args, **kwargs)
Bases: :py:obj:`optlang.symbolics.Symbol`
Holds information regarding a control parameter in a `DfbaModel` object.
.. attribute:: id
The identifier to associate with this control parameter.
:type: string
.. attribute:: change_points
The time points at which this control parameter changes value.
:type: list
.. attribute:: values
The values taken by this control parameter.
:type: list
.. method:: id(self) -> str
:property:
For convenience, synonym with .name from `symbolics.Symbol`.
.. method:: change_points(self) -> List
:property:
Time points at which this control parameter changes value.
.. method:: values(self) -> List
:property:
Actual values of the control parameter.
.. method:: set_parameters(self, change_points: List, values: List) -> None
Standardize input attributes.
.. class:: ExchangeFlux(name: str, *args, **kwargs)
Bases: :py:obj:`optlang.symbolics.Symbol`
Class for holding information for an exchange flux in a `DfbaModel` object.
.. attribute:: id
The identifier to associate with this exchange flux.
:type: string
.. attribute:: lower_bound_expression
The symbolic expression for calculating the lower bound of this
exchange flux.
:type: optlang.symbolics expression
.. attribute:: upper_bound_expression
The Symbolic expression for calculating the upper bound of this
exchange flux.
:type: optlang.symbolics expression
.. method:: id(self) -> str
:property:
For convenience, synonym with .name from `symbolics.Symbol`.
.. method:: lower_bound_expression(self) -> dfba.types.Expression
:property:
Relate the exchange rate to some symbolic expression.
.. method:: upper_bound_expression(self) -> dfba.types.Expression
:property:
Relate the exchange rate to some symbolic expression.
.. class:: KineticVariable(name: str, initial_condition: numbers.Number = 0.0, *args, **kwargs)
Bases: :py:obj:`optlang.symbolics.Symbol`
Class for holding information for a kinetic variable in a `DfbaModel` object.
.. attribute:: id
The identifier to associate with this kinetic variable.
:type: string
.. attribute:: rhs_expression
The symbolic expression for calculating derivative of this kinetic
variable wrt time.
:type: optlang.symbolics expression
.. attribute:: initital_condition
The initial value of this kinetic variable to be used at start of
simulation.
:type: int or float
.. method:: id(self) -> str
:property:
For convenience, synonym with .name from `symbolics.Symbol`.
.. method:: rhs_expression(self) -> Union[dfba.types.Expression, None]
:property:
Relate the rhs expression to some symbolic expression.
.. method:: initial_condition(self) -> numbers.Number
:property:
Relate the ininital condition to some int or float value.
.. class:: DfbaModel(cobra_object: cobra.Model)
Bases: :py:obj:`cobra.Object`
Class representation for a dynamic FBA model.
:param cobra_object: Existing `cobra.Model` object representing FBA model.
:type cobra_object: cobra.Model
.. attribute:: cobra_model
Existing `cobra.Model` object containing FBA model
(reactions, metabolites, objective).
:type: cobra.Model
.. attribute:: reactions
A `DictList` object where the key is the reaction identifier
and the value a `cobra.Reaction` object in cobra_model attribute.
:type: DictList
.. attribute:: objectives
A list containing identifiers of reactions to be used as objectives
in lexicographic optimization (currently not supported)
:type: list
.. attribute:: directions
A list containing directions (max or min) of each objective in
lexicographic optimization (currently not supported)
:type: list
.. attribute:: kinetic_variables
A `DictList` object where the key is the kinetic variable identifier
and the value a `KineticVariable` object.
:type: DictList
.. attribute:: exchange_fluxes
A `DictList` object where the key is the reaction identifier and the
value an `ExchangeFlux` object.
:type: DictList
.. attribute:: user_data
A read only attribute containing user data of the model
to be passed to algorithm prior to simulation.
:type: dfba_utils.UserData
.. attribute:: solver_data
An attribute containing data for the solver to be used for
simulation of the model.
:type: dfba_utils.SolverData
.. method:: add_objectives(self, objectives: List, directions: List) -> None
Add objectives.
:param objectives: The list of reaction indetifiers to be added to the model as
objectives for lexicographic optimization.
:type objectives: list
:param directions: The list of directions (max or min) of each objective to be
added to the model for lexicographic optimization.
:type directions: list
.. method:: add_kinetic_variables(self, kinetic_variable_list: List) -> None
Add kinetic variables.
:param kinetic_variable_list: The list of indetifiers of kinetic variables to be added to the
model.
:type kinetic_variable_list: list
.. method:: add_exchange_fluxes(self, exchange_flux_list: List) -> None
Add exchange fluxes.
:param exchange_flux_list: list of identifiers of exchange fluxes to be added to the model.
:type exchange_flux_list: list
.. method:: add_initial_conditions(self, initial_conditions: Dict) -> None
Add initial conditions.
:param initial_conditions: A dict where the key is the kinetic variable identifier and
the value an initial condition.
:type initial_conditions: dict
.. method:: add_rhs_expression(self, kinetic_variable_id: str, expression: dfba.types.Expression, control_parameters: Optional[List[dfba.control.ControlParameter]] = None) -> None
Add rhs expression.
:param kinetic_variable_id: Identifier of the kinetic variable to be supplied with
rhs expression for calculating its derivative wrt time.
:type kinetic_variable_id: string
:param expression: The symbolic expression for calculating derivative of kinetic
variable wrt time.
:type expression: optlang.symbolics expression
:param control_parameters: A list of `ControlParameter` objects (if any) appearing in the
supplied symbolic expression.
:type control_parameters: list
.. method:: 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.
:param exchange_flux_id: Indetifier of the exchange flux to be supplied with expression
for calculating its lower bound.
:type exchange_flux_id: string
:param 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.
:type expression: optlang.symbolics expression
:param condition: 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.
:type condition: optlang.symbolics expression
:param control_parameters: A list of `ControlParameter` objects (if any) appearing in the
supplied symbolic expression.
:type control_parameters: list
.. method:: 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.
:param exchange_flux_id: Indetifier of the exchange flux to be supplied with expression
for calculating its upper bound.
:type exchange_flux_id: string
:param 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.
:type expression: optlang.symbolics expression
:param condition: 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.
:type condition: optlang.symbolics expression
:param control_parameters: A list of `ControlParameter` objects (if any) appearing in the
supplied symbolic expression.
:type control_parameters: list
.. method:: simulate(self, tstart: float, tstop: float, tout: float, output_fluxes: Optional[List[str]] = None) -> Tuple[pandas.DataFrame, pandas.DataFrame]
Simulate model.
:param tstart: Initial time point to be used in simulation of the model.
:type tstart: float
:param tstop: Final time point to be used in simulation of the model.
:type tstop: float
:param tout: Output frequency to be used in simulation of the model.
:type tout: float
:param output_fluxes: Optional list of reaction ids whose fluxes are to be printed to
results along with kinetic variables.
:type output_fluxes: list
:returns:
1. time, concentrations (in `self.kinetic_variables`)
2. time, flux trajectories (in )
:rtype: tuple of 2 pd.Dataframe's
.. method:: lp_problem(self) -> dfba.types.Problem
LP problem.
:returns: **lp_problem** -- SWIGLPK object representing FBA model as pointer to GLPK problem
:rtype: Swig Object of type `glp_prob *`
.. method:: id(self) -> str
:property:
.
.. method:: cobra_model(self) -> cobra.Model
:property:
.
.. method:: reactions(self) -> cobra.DictList
:property:
.
.. method:: objectives(self) -> List
:property:
.
.. method:: directions(self) -> List
:property:
.
.. method:: kinetic_variables(self) -> cobra.DictList
:property:
.
.. method:: exchange_fluxes(self) -> cobra.DictList
:property:
.
.. method:: user_data(self) -> UserData
:property:
.
.. method:: solver_data(self) -> SolverData
:property:
.
.. method:: 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.
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.