Mercurial > repos > bimib > cobraxy
comparison COBRAxy/flux_simulation_beta.py @ 473:05a80f8e0574 draft
Uploaded
author | luca_milaz |
---|---|
date | Mon, 22 Sep 2025 15:32:47 +0000 |
parents | 46901af8df7c |
children | 6a88ae3f936f |
comparison
equal
deleted
inserted
replaced
472:00f2f3437ea3 | 473:05a80f8e0574 |
---|---|
76 help='choose sampling algorithm') | 76 help='choose sampling algorithm') |
77 | 77 |
78 parser.add_argument('-th', '--thinning', | 78 parser.add_argument('-th', '--thinning', |
79 type=int, | 79 type=int, |
80 default=100, | 80 default=100, |
81 required=False, | 81 required=True, |
82 help='choose thinning') | 82 help='choose thinning') |
83 | 83 |
84 parser.add_argument('-ns', '--n_samples', | 84 parser.add_argument('-ns', '--n_samples', |
85 type=int, | 85 type=int, |
86 required=True, | 86 required=True, |
97 help='choose how many batches') | 97 help='choose how many batches') |
98 | 98 |
99 parser.add_argument('-opt', '--perc_opt', | 99 parser.add_argument('-opt', '--perc_opt', |
100 type=float, | 100 type=float, |
101 default=0.9, | 101 default=0.9, |
102 required=False, | 102 required=True, |
103 help='choose the fraction of optimality for FVA (0-1)') | 103 help='choose the fraction of optimality for FVA (0-1)') |
104 | 104 |
105 parser.add_argument('-ot', '--output_type', | 105 parser.add_argument('-ot', '--output_type', |
106 type=str, | 106 type=str, |
107 required=True, | 107 required=True, |
346 | 346 |
347 Returns: | 347 Returns: |
348 List[pd.DataFrame]: A list of DataFrames containing statistics and analysis results. | 348 List[pd.DataFrame]: A list of DataFrames containing statistics and analysis results. |
349 """ | 349 """ |
350 | 350 |
351 if ARGS.sampling_enabled == "true" and ARGS.n_samples > 0: | 351 if ARGS.sampling_enabled == "true": |
352 | 352 |
353 if ARGS.algorithm == 'OPTGP': | 353 if ARGS.algorithm == 'OPTGP': |
354 OPTGP_sampler(model_input, cell_name, ARGS.n_samples, ARGS.thinning, ARGS.n_batches, ARGS.seed) | 354 OPTGP_sampler(model_input, cell_name, ARGS.n_samples, ARGS.thinning, ARGS.n_batches, ARGS.seed) |
355 elif ARGS.algorithm == 'CBS': | 355 elif ARGS.algorithm == 'CBS': |
356 CBS_sampler(model_input, cell_name, ARGS.n_samples, ARGS.n_batches, ARGS.seed) | 356 CBS_sampler(model_input, cell_name, ARGS.n_samples, ARGS.n_batches, ARGS.seed) |
497 ARGS.output_types = ARGS.output_type.split(",") if ARGS.output_type else [] | 497 ARGS.output_types = ARGS.output_type.split(",") if ARGS.output_type else [] |
498 # optional analysis output types -> list or empty | 498 # optional analysis output types -> list or empty |
499 ARGS.output_type_analysis = ARGS.output_type_analysis.split(",") if ARGS.output_type_analysis else [] | 499 ARGS.output_type_analysis = ARGS.output_type_analysis.split(",") if ARGS.output_type_analysis else [] |
500 | 500 |
501 # Determine if sampling should be performed | 501 # Determine if sampling should be performed |
502 if ARGS.sampling_enabled == "true" and ARGS.n_samples > 0: | 502 if ARGS.sampling_enabled == "true": |
503 perform_sampling = True | 503 perform_sampling = True |
504 | 504 |
505 print("=== INPUT FILES ===") | 505 print("=== INPUT FILES ===") |
506 print(f"{ARGS.input_files}") | 506 print(f"{ARGS.input_files}") |
507 print(f"{ARGS.file_names}") | 507 print(f"{ARGS.file_names}") |