: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 .. data:: __author__ :annotation: = David S. Tourigny, Columbia University Irving Medical Center, New York, USA Moritz E. Beber, Novo Nordisk Foundation Center for Biocustainability, Technical University of Denmark .. data:: __email__ :annotation: = dst2156@cumc.columbia.edu morbeb@biosustain.dtu.dk .. function:: get_versions() Get version information or return default if unable to do so. .. data:: __version__ .. function:: show_versions() -> None Print dependency information. .. py:class:: ControlParameter(name: str, change_point: str = None, values: List = None, change_points: List = None, *args, **kwargs) Bases: :class:`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 .. attribute:: id :annotation: :str For convenience, synonym with .name from `symbolics.Symbol`. .. attribute:: change_points :annotation: :List Time points at which this control parameter changes value. .. attribute:: values :annotation: :List Actual values of the control parameter. .. method:: set_parameters(self, change_points: List, values: List) Standardize input attributes. .. py:class:: ExchangeFlux(name: str, *args, **kwargs) Bases: :class:`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 .. attribute:: id :annotation: :str For convenience, synonym with .name from `symbolics.Symbol`. .. attribute:: lower_bound_expression :annotation: :Expression Relate the exchange rate to some symbolic expression. .. attribute:: upper_bound_expression :annotation: :Expression Relate the exchange rate to some symbolic expression. .. py:class:: KineticVariable(name: str, initial_condition: Number = 0.0, *args, **kwargs) Bases: :class:`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 .. attribute:: id :annotation: :str For convenience, synonym with .name from `symbolics.Symbol`. .. attribute:: rhs_expression :annotation: :Union[Expression, None] Relate the rhs expression to some symbolic expression. .. attribute:: initial_condition :annotation: :Number Relate the ininital condition to some int or float value. .. py:class:: DfbaModel(cobra_object: Model) Bases: :class:`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 .. attribute:: id :annotation: :str . .. attribute:: cobra_model :annotation: :Model . .. attribute:: reactions :annotation: :DictList . .. attribute:: objectives :annotation: :List . .. attribute:: directions :annotation: :List . .. attribute:: kinetic_variables :annotation: :DictList . .. attribute:: exchange_fluxes :annotation: :DictList . .. attribute:: user_data :annotation: :UserData . .. attribute:: solver_data :annotation: :SolverData . .. method:: add_objectives(self, objectives: List, directions: List) 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) 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) 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) 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: Expression, control_parameters: Optional[List[ControlParameter]] = 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: Expression, condition: Optional[Expression] = None, control_parameters: Optional[List[ControlParameter]] = 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: Expression, condition: Optional[Expression] = None, control_parameters: Optional[List[ControlParameter]] = 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) 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) LP problem. :returns: **lp_problem** -- SWIGLPK object representing FBA model as pointer to GLPK problem :rtype: Swig Object of type `glp_prob *` .. method:: add_to_library(self, tstart: float, tstop: float, tout: float, print_fluxes: List[Reaction], directory: str) 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.