Mercurial > repos > bimib > cobraxy
comparison COBRAxy/custom_data_generator.py @ 395:64563ca68ace draft
Uploaded
| author | francesco_lapi |
|---|---|
| date | Fri, 05 Sep 2025 13:22:34 +0000 |
| parents | 52658ddcaa5d |
| children | dab29c3a5281 |
comparison
equal
deleted
inserted
replaced
| 394:a0b53ccc73a8 | 395:64563ca68ace |
|---|---|
| 227 raise utils.DataErr(ARGS.model, f"failed loading built-in model: {e}") | 227 raise utils.DataErr(ARGS.model, f"failed loading built-in model: {e}") |
| 228 | 228 |
| 229 # Determine final model name: explicit --name overrides, otherwise use the model id | 229 # Determine final model name: explicit --name overrides, otherwise use the model id |
| 230 | 230 |
| 231 model_name = ARGS.name if ARGS.name else ARGS.model | 231 model_name = ARGS.name if ARGS.name else ARGS.model |
| 232 | 232 print(ARGS.name) |
| 233 print(model_name) | |
| 234 print(ARGS.medium_selector) | |
| 233 | 235 |
| 234 if ARGS.name == "ENGRO2" and ARGS.medium_selector != "Default": | 236 if ARGS.name == "ENGRO2" and ARGS.medium_selector != "Default": |
| 235 df_mediums = pd.read_csv(ARGS.tool_dir + "/local/medium/medium.csv", index_col = 0) | 237 df_mediums = pd.read_csv(ARGS.tool_dir + "/local/medium/medium.csv", index_col = 0) |
| 236 ARGS.medium_selector = ARGS.medium_selector.replace("_", " ") | 238 ARGS.medium_selector = ARGS.medium_selector.replace("_", " ") |
| 237 medium = df_mediums[[ARGS.medium_selector]] | 239 medium = df_mediums[[ARGS.medium_selector]] |
| 245 for reaction, value in medium.items(): | 247 for reaction, value in medium.items(): |
| 246 if value is not None: | 248 if value is not None: |
| 247 model.reactions.get_by_id(reaction).lower_bound = -float(value) | 249 model.reactions.get_by_id(reaction).lower_bound = -float(value) |
| 248 | 250 |
| 249 if ARGS.name == "ENGRO2" and ARGS.gene_format != "Default": | 251 if ARGS.name == "ENGRO2" and ARGS.gene_format != "Default": |
| 250 utils.convert_genes(model, ARGS.gene_format) | 252 model = utils.convert_genes(model, ARGS.gene_format) |
| 251 | 253 |
| 252 # generate data | 254 # generate data |
| 253 rules = generate_rules(model, asParsed = False) | 255 rules = generate_rules(model, asParsed = False) |
| 254 reactions = generate_reactions(model, asParsed = False) | 256 reactions = generate_reactions(model, asParsed = False) |
| 255 bounds = generate_bounds(model) | 257 bounds = generate_bounds(model) |
