# HG changeset patch # User luca_milaz # Date 1758611969 0 # Node ID 1c6fcf97cabe6e01ad5a3ed5e4cf68d43d54d600 # Parent 1d1fa7e274bbecd497bd0c8c90ec8869205fda26 Uploaded diff -r 1d1fa7e274bb -r 1c6fcf97cabe COBRAxy/flux_simulation_beta.py --- a/COBRAxy/flux_simulation_beta.py Mon Sep 22 17:16:12 2025 +0000 +++ b/COBRAxy/flux_simulation_beta.py Tue Sep 23 07:19:29 2025 +0000 @@ -425,7 +425,8 @@ def fluxes_analysis(model:cobra.Model, model_name:str, output_types:List)-> List[pd.DataFrame]: """ - Performs flux analysis including pFBA, FVA, and sensitivity analysis. + Performs flux analysis including pFBA, FVA, and sensitivity analysis. The objective function + is assumed to be already set in the model. Args: model (cobra.Model): The COBRA model to analyze. @@ -442,7 +443,6 @@ for output_type in output_types: if(output_type == "pFBA"): - model.objective = "Biomass" solution = cobra.flux_analysis.pfba(model) fluxes = solution.fluxes df_pFBA.loc[0,[rxn.id for rxn in model.reactions]] = fluxes.tolist() @@ -463,7 +463,6 @@ df_FVA.index = [model_name] df_FVA = df_FVA.astype(float).round(6) elif(output_type == "sensitivity"): - model.objective = "Biomass" solution_original = model.optimize().objective_value reactions = model.reactions single = cobra.flux_analysis.single_reaction_deletion(model)