changeset 227:14ac8f47c9e0 draft

Uploaded
author luca_milaz
date Sat, 03 Aug 2024 11:11:16 +0000
parents 1bc73b131257
children 0ec43a4b4a8f
files marea_2/flux_simulation.py
diffstat 1 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/marea_2/flux_simulation.py	Sat Aug 03 08:54:14 2024 +0000
+++ b/marea_2/flux_simulation.py	Sat Aug 03 11:11:16 2024 +0000
@@ -242,15 +242,15 @@
             df_median = df_median.reset_index(drop=True)
             df_median.index = [model_name]
         elif(output_type == "quantiles"):
-            df_quantile = df_samples.quantile([0.25, 0.5, 0.75])
             newRow = []
             cols = []
-            for rxn in df_quantile.columns:
-                newRow.append(df_quantile[rxn].loc[0.25])
+            for rxn in df_samples.columns:
+                quantiles = df_samples[rxn].quantile([0.25, 0.50, 0.75])
+                newRow.append(quantiles[0.25])
                 cols.append(rxn + "_q1")
-                newRow.append(df_quantile[rxn].loc[0.5])
+                newRow.append(quantiles[0.5])
                 cols.append(rxn + "_q2")
-                newRow.append(df_quantile[rxn].loc[0.75])
+                newRow.append(quantiles[0.75])
                 cols.append(rxn + "_q3")
             df_quantiles = pd.DataFrame(columns=cols)
             df_quantiles.loc[0] = newRow
@@ -340,33 +340,33 @@
     if("mean" in ARGS.output_types):
         all_mean = all_mean.fillna(0.0)
         all_mean = all_mean.sort_index()
-        write_to_file(all_mean, "mean", True)
+        write_to_file(all_mean, "mean", False)
 
     if("median" in ARGS.output_types):
         all_median = all_median.fillna(0.0)
         all_median = all_median.sort_index()
-        write_to_file(all_median, "median", True)
+        write_to_file(all_median, "median", False)
     
     if("quantiles" in ARGS.output_types):
         all_quantiles = all_quantiles.fillna(0.0)
         all_quantiles = all_quantiles.sort_index()
-        write_to_file(all_quantiles, "quantiles", True)
+        write_to_file(all_quantiles, "quantiles", False)
 
     index_result = 3
     if("pFBA" in ARGS.output_type_analysis):
         all_pFBA = pd.concat([result[index_result] for result in results], ignore_index=False)
         all_pFBA = all_pFBA.sort_index()
-        write_to_file(all_pFBA, "pFBA", True)
+        write_to_file(all_pFBA, "pFBA", False)
         index_result+=1
     if("FVA" in ARGS.output_type_analysis):
         all_FVA= pd.concat([result[index_result] for result in results], ignore_index=False)
         all_FVA = all_FVA.sort_index()
-        write_to_file(all_FVA, "FVA", True)
+        write_to_file(all_FVA, "FVA", False)
         index_result+=1
     if("sensitivity" in ARGS.output_type_analysis):
         all_sensitivity = pd.concat([result[index_result] for result in results], ignore_index=False)
         all_sensitivity = all_sensitivity.sort_index()
-        write_to_file(all_sensitivity, "sensitivity", True)
+        write_to_file(all_sensitivity, "sensitivity", False)
 
     pass