From 3d8f7f069d76cd6ee35b5e9d72d37e38721188d2 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 16 Sep 2021 10:13:10 +0300 Subject: run cmd and add exception handler --- gn3/computations/wgcna.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gn3') diff --git a/gn3/computations/wgcna.py b/gn3/computations/wgcna.py index bcd3a0a..f0f0fa2 100644 --- a/gn3/computations/wgcna.py +++ b/gn3/computations/wgcna.py @@ -29,5 +29,9 @@ def compose_wgcna_cmd(rscript_path: str, temp_file_path: str): def call_wgcna_script(rscript_path: str, request_data: dict): """function to call wgcna script""" generated_file = dump_wgcna_data(request_data) - cmd = compose_gemma_cmd(rscript_path, generated_file) - run_cmd(cmd=cmd) + cmd = compose_wgcna_cmd(rscript_path, generated_file) + + try: + return run_cmd(cmd) + except Exception as error: + raise error -- cgit v1.2.3