solving
pfba_Weighted
pfba_Weighted (model, weightings=None, fraction_of_optimum=1.0, objective=None, reactions=None)
*Perform basic pFBA (parsimonious Enzyme Usage Flux Balance Analysis) to minimize total flux. 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.
Parameters:
model : cobra.Model The model fraction_of_optimum : float, optional Fraction of optimum which must be maintained. The original objective reaction is constrained to be greater than maximal_value * fraction_of_optimum. objective : dict or model.problem.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. reactions : iterable List of reactions or reaction identifiers. Implies return_frame
to be true. Only return fluxes for the given reactions. Faster than fetching all fluxes if only a few are needed.
Returns:
cobra.Solution
The solution object to the optimized model with pFBA constraints added.
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*
add_pfba_Weighted
add_pfba_Weighted (model, weightings=None, objective=None, fraction_of_optimum=1.0)
*This function is a modified version of cobrapy add_pfba function
Add pFBA objective Add objective to minimize the summed flux of all reactions to the current objective.
See Also: pfba
Parameters: model : cobra.Model The model to add the objective to objective : An objective to set in combination with the pFBA objective. fraction_of_optimum : float Fraction of optimum which must be maintained. The original objective reaction is constrained to be greater than maximal_value fraction_of_optimum.
get_weightings
get_weightings (model)
This function is used by pfba_weighted to generate default weightings for the guard cell model It takes the model as an argument and returns the weightings based on the phase lengths of the model.
flux_variability_analysis
flux_variability_analysis (model, reaction_list:Optional[List[Union[ForwardRef(' Reaction'),str]]]=None, loopless:bool=False, fraction_of_optimum:float=1.0, pfba_factor:Optional[float]=None, processes:Optional[int]=None)
Determine the minimum and maximum flux value for each reaction.
Type | Default | Details | |
---|---|---|---|
model | cobra.Model | The model for which to run the analysis. It will not be modified. | |
reaction_list | Optional | None | The reactions for which to obtain min/max fluxes. If None will use all reactions in the model (default None). |
loopless | bool | False | Whether to return only loopless solutions. This is significantly slower. Please also refer to the notes (default False). |
fraction_of_optimum | float | 1.0 | Must be <= 1.0. Requires that the objective value is at least the fraction times maximum objective value. A value of 0.85 for instance means that the objective has to be at least at 85% percent of its maximum (default 1.0). |
pfba_factor | Optional | None | Add an additional constraint to the model that requires the total sum of absolute fluxes must not be larger than this value times the smallest possible sum of absolute fluxes, i.e., by setting the value to 1.1 the total sum of absolute fluxes must not be more than 10% larger than the pFBA solution. Since the pFBA solution is the one that optimally minimizes the total flux sum, the pfba_factor should, if set, be larger than one. Setting this value may lead to more realistic predictions of the effective flux bounds (default None). |
processes | Optional | None | The number of parallel processes to run. If not explicitly passed, will be set from the global configuration singleton (default None). |
Returns | DataFrame | A data frame with reaction identifiers as the index and two columns: - maximum: indicating the highest possible flux - minimum: indicating the lowest possible flux |
pFBA_FVA_run
pFBA_FVA_run (cobra_model, obj, rxnlist=[], processes=3, fix_sof_for_fva=False)
get_sum_of_fluxes
get_sum_of_fluxes (model)
rev2irrev
rev2irrev (cobra_model)
*Function to convert any model with reversible reactions to a copy of the same m- -odel with only irreversible reactions. ID of reverse reactions are generated by suffixing “_reverse” to the ID of the orignal reaction. args: 1) a cobra model output: a cobra model with only irreversible reactions*
check_fba_fva_run
check_fba_fva_run (fba_model, pfba_solution)
This is a test that checks if the fluxes that are returned by the fba model are different to those by the pFBA
get_pfba_fva_solution
get_pfba_fva_solution (fba_model, rxn_list=[], objective='Phloem_tx_overall', processes=3, fix_sof_for_fva=False)
Take FBA model and solve weighted FVA on a list of reactions. Returns a dataframe with flux of all reactions and minimum and maximum if they were in the fva list