Mercurial > repos > bimib > cobraxy
comparison COBRAxy/custom_data_generator.py @ 359:820befcfb42f draft
Uploaded
author | francesco_lapi |
---|---|
date | Thu, 04 Sep 2025 23:27:52 +0000 |
parents | be93df100d60 |
children | ca5d82f9075f |
comparison
equal
deleted
inserted
replaced
358:3fc99f6b7668 | 359:820befcfb42f |
---|---|
20 description="Generate custom data from a given model" | 20 description="Generate custom data from a given model" |
21 ) | 21 ) |
22 | 22 |
23 parser.add_argument("--out_log", type=str, required=True, | 23 parser.add_argument("--out_log", type=str, required=True, |
24 help="Output log file") | 24 help="Output log file") |
25 parser.add_argument("--out_data", type=str, required=True, | |
26 help="Single output dataset (CSV or Excel)") | |
27 | 25 |
28 parser.add_argument("--model", type=str, | 26 parser.add_argument("--model", type=str, |
29 help="Built-in model identifier (e.g., ENGRO2, Recon, HMRcore)") | 27 help="Built-in model identifier (e.g., ENGRO2, Recon, HMRcore)") |
30 parser.add_argument("--input", type=str, | 28 parser.add_argument("--input", type=str, |
31 help="Custom model file (JSON or XML)") | 29 help="Custom model file (JSON or XML)") |
249 | 247 |
250 merged["InMedium"] = merged["InMedium"].fillna(False) | 248 merged["InMedium"] = merged["InMedium"].fillna(False) |
251 | 249 |
252 merged = merged.sort_values(by = "InMedium", ascending = False) | 250 merged = merged.sort_values(by = "InMedium", ascending = False) |
253 | 251 |
254 out_file = os.path.join(ARGS.output_path, f"{os.path.basename(ARGS.name).split('.')[0]}_custom_data") | 252 #out_file = os.path.join(ARGS.output_path, f"{os.path.basename(ARGS.name).split('.')[0]}_custom_data") |
255 | 253 |
256 #merged.to_csv(out_file, sep = '\t', index = False) | 254 #merged.to_csv(out_file, sep = '\t', index = False) |
257 | 255 |
258 | 256 |
259 #### | 257 #### |
260 out_data_path = ARGS.out_data | 258 out_data_path = ARGS.output_path |
261 | 259 |
262 if ARGS.output_format == "xlsx": | 260 if ARGS.output_format == "xlsx": |
263 merged.to_excel(out_data_path, index=False) | 261 merged.to_excel(out_data_path, index=False) |
264 else: | 262 else: |
265 merged.to_csv(out_data_path, sep="\t", index=False) | 263 merged.to_csv(out_data_path, sep="\t", index=False) |