_optimize_ensemble(ensemble, return_flux, member_id, **kwargs)¶
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.
- 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.
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.