changeset 159:898f2641d3f7 draft

Uploaded
author francesco_lapi
date Tue, 12 Nov 2024 16:58:48 +0000
parents 30acaa01df61
children e1b0ddc770a9
files COBRAxy/flux_simulation.py
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/COBRAxy/flux_simulation.py	Tue Nov 12 14:19:01 2024 +0000
+++ b/COBRAxy/flux_simulation.py	Tue Nov 12 16:58:48 2024 +0000
@@ -88,11 +88,10 @@
                         required = False,
                         help = 'output type analysis')
     
-    parser.add_argument(
-        '-idop', '--output_path', 
-        type = str,
-        default='flux_simulation',
-        help = 'output path for maps')
+    parser.add_argument('-idop', '--output_path', 
+                        type = str,
+                        default='flux_simulation',
+                        help = 'output path for maps')
     
     ARGS = parser.parse_args(args)
     return ARGS
@@ -239,7 +238,7 @@
         model_input.reactions.get_by_id(rxn_index).lower_bound = row.lower_bound
         model_input.reactions.get_by_id(rxn_index).upper_bound = row.upper_bound
     
-    name = cell_name
+    name = cell_name.split('.')[0]
     
     if ARGS.algorithm == 'OPTGP':
         OPTGP_sampler(model_input, name, ARGS.n_samples, ARGS.thinning, ARGS.n_batches, ARGS.seed)
@@ -382,9 +381,8 @@
     global ARGS
     ARGS = process_args(args)
 
-    if not os.path.exists('flux_simulation/'):
-        os.makedirs('flux_simulation/')
-  
+    if not os.path.exists(ARGS.output_path):
+        os.makedirs(ARGS.output_path)
     
     model_type :utils.Model = ARGS.model_selector
     if model_type is utils.Model.Custom: