# HG changeset patch # User luca_milaz # Date 1722685947 0 # Node ID 8e66f173ad60a101095107f638e5b39483b9cc88 # Parent c27fe0032287f13fcb27cf32d608d2d2d98ae658 Uploaded diff -r c27fe0032287 -r 8e66f173ad60 marea_2/flux_simulation.py --- 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')