diff options
author | Alexander Kabui | 2022-01-13 15:23:49 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-01-22 09:23:14 +0300 |
commit | 2cc2897fecc5f5f4d1338c33ef8197f7ebba140c (patch) | |
tree | 0b4d034b5fea2822c5f621611b16b86261e15736 /gn3/computations | |
parent | 0109efc7abf483f990557197fdd22610d93097b9 (diff) | |
download | genenetwork3-2cc2897fecc5f5f4d1338c33ef8197f7ebba140c.tar.gz |
read stdout data;handle exceptions
Diffstat (limited to 'gn3/computations')
-rw-r--r-- | gn3/computations/ctl.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gn3/computations/ctl.py b/gn3/computations/ctl.py index c4955a0..8f20b65 100644 --- a/gn3/computations/ctl.py +++ b/gn3/computations/ctl.py @@ -1,4 +1,5 @@ """module contains code to process ctl analysis data""" +import json from gn3.commands import run_cmd from gn3.computations.wgcna import dump_wgcna_data @@ -14,7 +15,11 @@ def call_ctl_script(data): try: cmd_results = run_cmd(cmd) print(cmd_results) - except Exception as e: - raise e + with open(temp_file_name,"r") as outputfile: + if cmd_results["code"] != 0: + return cmd_results + return json.load(outputfile) + - return "hello" + except Exception as e: + return str(e) |