From 1c392b4b2786d196af6b882e80270b8cb839f554 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 23 Sep 2021 15:38:50 +0300 Subject: read generated files from r and return output --- gn3/computations/wgcna.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gn3') 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 -- cgit v1.2.3