Mercurial > repos > bimib > cobraxy
changeset 325:2aea7e27ae0f draft default tip
Uploaded
author | francesco_lapi |
---|---|
date | Mon, 23 Jun 2025 20:24:20 +0000 |
parents | a8f50dc2ac4c |
children | |
files | COBRAxy/utils/CBS_backend.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/COBRAxy/utils/CBS_backend.py Thu Jun 19 13:34:03 2025 +0000 +++ b/COBRAxy/utils/CBS_backend.py Mon Jun 23 20:24:20 2025 +0000 @@ -179,8 +179,8 @@ c=2*random.random()-1 #coefficiente tra -1 e 1 - val_max=np.max([df_fva.loc[reaction,"minimum"],df_fva.loc[reaction,"maximum"]]) - + val_max = np.max([abs(df_fva.loc[reaction,"minimum"]), abs(df_fva.loc[reaction,"maximum"])]) + if val_max!=0: #solo se la fva รจ diversa da zero coefficients_df.loc[reaction,str(i)] = c/val_max #divido per la fva else: @@ -197,4 +197,4 @@ else: coefficients_df.loc["type_of_problem",str(i)] = 1 #minimize - return coefficients_df \ No newline at end of file + return coefficients_df