Mercurial > repos > bimib > cobraxy
comparison COBRAxy/ras_generator.py @ 400:e94735cb40fa draft
Uploaded
| author | francesco_lapi |
|---|---|
| date | Sun, 07 Sep 2025 20:07:44 +0000 |
| parents | 09064ce8f095 |
| children | 6c7ddf68381a |
comparison
equal
deleted
inserted
replaced
| 399:172b3959dccf | 400:e94735cb40fa |
|---|---|
| 637 Returns: | 637 Returns: |
| 638 Dict[str, ruleUtils.OpList] : dict mapping reaction IDs to rules. | 638 Dict[str, ruleUtils.OpList] : dict mapping reaction IDs to rules. |
| 639 """ | 639 """ |
| 640 datFilePath = utils.FilePath.fromStrPath(ARGS.model_upload) # actual file, stored in galaxy as a .dat | 640 datFilePath = utils.FilePath.fromStrPath(ARGS.model_upload) # actual file, stored in galaxy as a .dat |
| 641 | 641 |
| 642 try: filenamePath = utils.FilePath.fromStrPath(ARGS.model_upload_name) # file's name in input, to determine its original ext | 642 #try: filenamePath = utils.FilePath.fromStrPath(ARGS.model_upload_name) # file's name in input, to determine its original ext |
| 643 except utils.PathErr as err: | 643 #except utils.PathErr as err: |
| 644 raise utils.PathErr(filenamePath, f"Please make sure your file's name is a valid file path, {err.msg}") | 644 # utils.logWarning(f"Cannot determine file extension from filename '{ARGS.model_upload_name}'. Assuming tabular format.", ARGS.out_log) |
| 645 # filenamePath = None | |
| 645 | 646 |
| 646 if filenamePath.ext is utils.FileFormat.PICKLE: return utils.readPickle(datFilePath) | 647 #if filenamePath.ext is utils.FileFormat.PICKLE: return utils.readPickle(datFilePath) |
| 647 | 648 |
| 648 dict_rule = {} | 649 dict_rule = {} |
| 649 for line in utils.readCsv(datFilePath, delimiter = "\t"): | 650 for line in utils.readCsv(datFilePath, delimiter = "\t"): |
| 650 if line[2] == "": | 651 if line[2] == "": |
| 651 dict_rule[line[0]] = ruleUtils.OpList([""]) | 652 dict_rule[line[0]] = ruleUtils.OpList([""]) |
