aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
authorAlexander Kabui2021-09-23 15:38:50 +0300
committerAlexander Kabui2021-09-23 15:38:50 +0300
commit1c392b4b2786d196af6b882e80270b8cb839f554 (patch)
tree928b0279e774e5b93f419dbc6ef8164cb85fca35 /gn3
parent9c221e0d89603acd5412be95650a469824e2ab99 (diff)
downloadgenenetwork3-1c392b4b2786d196af6b882e80270b8cb839f554.tar.gz
read generated files from r and return output
Diffstat (limited to 'gn3')
-rw-r--r--gn3/computations/wgcna.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/gn3/computations/wgcna.py b/gn3/computations/wgcna.py
index f0f0fa2..689bc2d 100644
--- a/gn3/computations/wgcna.py
+++ b/gn3/computations/wgcna.py
@@ -22,7 +22,7 @@ def dump_wgcna_data(request_data: dict):
def compose_wgcna_cmd(rscript_path: str, temp_file_path: str):
"""function to componse wgcna cmd"""
- cmd = f"Rscript {rscript_path} {temp_file_path}"
+ cmd = f"Rscript ./scripts/{rscript_path} {temp_file_path}"
return cmd
@@ -32,6 +32,9 @@ def call_wgcna_script(rscript_path: str, request_data: dict):
cmd = compose_wgcna_cmd(rscript_path, generated_file)
try:
- return run_cmd(cmd)
+
+ run_cmd(cmd)
+ with open(generated_file, "r") as outputfile:
+ return results
except Exception as error:
raise error