changeset 231:8e66f173ad60 draft

Uploaded
author luca_milaz
date Sat, 03 Aug 2024 11:52:27 +0000
parents c27fe0032287
children 1c8792454765
files marea_2/flux_simulation.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/marea_2/flux_simulation.py	Sat Aug 03 11:43:47 2024 +0000
+++ b/marea_2/flux_simulation.py	Sat Aug 03 11:52:27 2024 +0000
@@ -108,7 +108,7 @@
 
 
 def write_to_file(dataset: pd.DataFrame, name: str, keep_index:bool=False)->None:
-    dataset = dataset.T
+    dataset.index.name = 'Reactions'
     dataset.to_csv(ARGS.output_folder + name + ".csv", sep = '\t', index = keep_index)
 
 ############################ dataset input ####################################
@@ -149,7 +149,7 @@
         samples_batch = pd.read_csv(ARGS.output_folder  +  model_name + '_'+ str(i)+'_OPTGP.csv')
         samplesTotal = pd.concat([samplesTotal, samples_batch], ignore_index = True)
 
-    write_to_file(samplesTotal, model_name)
+    write_to_file(samplesTotal.T, model_name, True)
 
     for i in range(0, n_batches):
         os.remove(ARGS.output_folder +   model_name + '_'+ str(i)+'_OPTGP.csv')
@@ -180,7 +180,7 @@
         samples_batch = pd.read_csv(ARGS.output_folder  +  model_name + '_'+ str(i)+'_CBS.csv')
         samplesTotal = pd.concat([samplesTotal, samples_batch], ignore_index = True)
 
-    write_to_file(samplesTotal, model_name)
+    write_to_file(samplesTotal.T, model_name, True)
 
     for i in range(0, n_batches):
         os.remove(ARGS.output_folder +   model_name + '_'+ str(i)+'_CBS.csv')