cobra.flux_analysis.parsimonious
================================

.. py:module:: cobra.flux_analysis.parsimonious

.. autoapi-nested-parse::

   Provide parsimonious FBA implementation.



Functions
---------

.. autoapisummary::

   cobra.flux_analysis.parsimonious.optimize_minimal_flux
   cobra.flux_analysis.parsimonious.pfba
   cobra.flux_analysis.parsimonious.add_pfba


Module Contents
---------------

.. py:function:: optimize_minimal_flux(*args, **kwargs) -> Callable[[cobra.Model, float, Union[Dict, optlang.interface.Objective], List[cobra.Reaction]], cobra.Solution]

   Perform basic pFBA to minimize total flux.

   .. deprecated:: 0.6.0a4
           `optimize_minimal_flux` will be removed in cobrapy 1.0.0, it is
           replaced by `pfba`.

   :param \*args: Non-keyword variable-length arguments.
   :type \*args: Any
   :param \*\*kwargs: Keyword-only variable-length arguments.
   :type \*\*kwargs: Any

   :rtype: A function performing the parsimonious FBA.


.. py:function:: pfba(model: cobra.Model, fraction_of_optimum: float = 1.0, objective: Union[Dict, optlang.interface.Objective, None] = None, reactions: Optional[List[cobra.Reaction]] = None) -> cobra.Solution

   Perform basic pFBA (parsimonious Enzyme Usage Flux Balance Analysis).

   pFBA [1] adds the minimization of all fluxes the the objective of the
   model. This approach is motivated by the idea that high fluxes have a
   higher enzyme turn-over and that since producing enzymes is costly,
   the cell will try to minimize overall flux while still maximizing the
   original objective function, e.g. the growth rate.

   :param model: The model to perform pFBA on.
   :type model: cobra.Model
   :param fraction_of_optimum: The fraction of optimum which must be maintained. The original
                               objective reaction is constrained to be greater than maximal value
                               times the `fraction_of_optimum` (default 1.0).
   :type fraction_of_optimum: float, optional
   :param objective: A desired objective to use during optimization in addition to the
                     pFBA objective. Dictionaries (reaction as key, coefficient as value)
                     can be used for linear objectives (default None).
   :type objective: dict or cobra.Model.objective, optional
   :param reactions: List of cobra.Reaction. Implies `return_frame` to be true. Only
                     return fluxes for the given reactions. Faster than fetching all
                     fluxes if only a few are needed (default None).
   :type reactions: list of cobra.Reaction, optional

   :returns: The solution object to the optimized model with pFBA constraints
             added.
   :rtype: cobra.Solution

   .. rubric:: References

   .. [1] Lewis, N. E., Hixson, K. K., Conrad, T. M., Lerman, J. A.,
      Charusanti, P., Polpitiya, A. D., Palsson, B. O. (2010). Omic data
      from evolved E. coli are consistent with computed optimal growth from
      genome-scale models. Molecular Systems Biology, 6,
      390. doi:10.1038/msb.2010.47


.. py:function:: add_pfba(model: cobra.Model, objective: Union[Dict, optlang.interface.Objective, None] = None, fraction_of_optimum: float = 1.0) -> None

   Add pFBA objective to the `model`.

   This adds objective to minimize the summed flux of all reactions to the
   current objective.

   :param model: The model to add the objective to.
   :type model: cobra.Model
   :param objective: A desired objective to use during optimization in addition to the
                     pFBA objective. Dictionaries (reaction as key, coefficient as value)
                     can be used for linear objectives (default None).
   :type objective: dict or cobra.Model.objective, optional
   :param fraction_of_optimum: Fraction of optimum which must be maintained. The original objective
                               reaction is constrained to be greater than maximal value times the
                               `fraction_of_optimum`.
   :type fraction_of_optimum: float, optional

   .. seealso:: :py:obj:`pfba`


