medusa.flux_analysis.flux_balance

Module Contents

medusa.flux_analysis.flux_balance._optimize_ensemble(ensemble, return_flux, member_id, **kwargs)
medusa.flux_analysis.flux_balance._optimize_ensemble_worker(member_id)
medusa.flux_analysis.flux_balance._init_worker(ensemble, return_flux)
medusa.flux_analysis.flux_balance.optimize_ensemble(ensemble, return_flux=None, num_models=None, specific_models=None, num_processes=None, **kwargs)

Performs flux balance analysis (FBA) on models within an ensemble.

Parameters:
  • ensemble (medusa.core.Ensemble) – The ensemble on which FBA is to be performed.
  • return_flux (str or list of str, optional) – List of reaction ids (cobra.core.reaction.id), or a single reaction id, for which to return flux values. If None, all reaction fluxes are returned (default).
  • num_models (int, optional) – Number of models for which FBA will be performed. The number of models indicated will be randomly sampled and FBA will be performed on the sampled models. If None, all models will be selected (default), or the models specified by specific_models will be selected. Cannot be passed concurrently with specific_models.
  • specific_models (list of str, optional) – List of ensemble_member.id corresponding to the models for which FBA will be performed. If None, all models will be selected (default), or num_models will be randomly sampled and selected. Cannot be passed concurrently with num_models.
  • num_processes (int, optional) – An integer corresponding to the number of processes (i.e. cores) to use. Using more cores will speed up computation, but will have a larger memory footprint because the ensemble object must be temporarily copied for each additional core used. If None, one core is used.
Returns:

A dataframe in which each row (index) represents a model within the ensemble, and each column represents a reaction for which flux values are returned.

Return type:

pandas.DataFrame