aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations
diff options
context:
space:
mode:
authorAlexander Kabui2021-10-13 08:11:25 +0300
committerBonfaceKilz2021-10-25 14:16:21 +0300
commit4c2cf2aceb044d00fe5e41ac40a07fe614737ef2 (patch)
tree15be3f2e801576b33ed1ab38ba9e3495dd3f7ac6 /gn3/computations
parentd1be5270b99959f99802a7704562eeaaeb504122 (diff)
downloadgenenetwork3-4c2cf2aceb044d00fe5e41ac40a07fe614737ef2.tar.gz
fix unittests
Diffstat (limited to 'gn3/computations')
-rw-r--r--gn3/computations/wgcna.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/gn3/computations/wgcna.py b/gn3/computations/wgcna.py
index f7463c5..90db455 100644
--- a/gn3/computations/wgcna.py
+++ b/gn3/computations/wgcna.py
@@ -66,26 +66,25 @@ def call_wgcna_script(rscript_path: str, request_data: dict):
generated_file = dump_wgcna_data(request_data)
cmd = compose_wgcna_cmd(rscript_path, generated_file)
- stream_cmd_output(request_data, cmd)
+ # stream_cmd_output(request_data, cmd) disable streaming of data
try:
- # run_cmd_results = run_cmd(cmd)
+ run_cmd_results = run_cmd(cmd)
with open(generated_file, "r") as outputfile:
+ if run_cmd_results["code"] != 0:
+ return run_cmd_results
+
output_file_data = json.load(outputfile)
- # json format only supports unicode string// to get image data reconvert
output_file_data["output"]["image_data"] = process_image(
output_file_data["output"]["imageLoc"]).decode("ascii")
- output_file_data["output"]["image_data2"] = process_image(
- output_file_data["output"]["heatMap"]).decode("ascii")
+ # json format only supports unicode string// to get image data reconvert
- # if run_cmd_results["code"] != 0:
- # return run_cmd_results
return {
"data": output_file_data,
- "output": ""
+ **run_cmd_results
}
except FileNotFoundError:
# relook at handling errors gn3