From fed7009b5eec9cc8b9370d4fb8486c7e4136b3d4 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Wed, 23 Jun 2021 10:18:54 +0300 Subject: minor fixes for biweight script --- gn3/computations/biweight.py | 10 ++++++---- gn3/settings.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'gn3') diff --git a/gn3/computations/biweight.py b/gn3/computations/biweight.py index 6d031ad..0377bdf 100644 --- a/gn3/computations/biweight.py +++ b/gn3/computations/biweight.py @@ -19,7 +19,9 @@ def calculate_biweight_corr(trait_vals: List, cmd = [command, path_to_script] + [args_1] + [args_2] results = subprocess.check_output(cmd, universal_newlines=True) - - (corr_coeff, p_val) = tuple([float(y) for y in results.split()]) - - return (corr_coeff, p_val) + try: + (corr_coeff, p_val) = tuple( + [float(y.strip()) for y in results.split()]) + return (corr_coeff, p_val) + except Exception as e: + raise e diff --git a/gn3/settings.py b/gn3/settings.py index 770ba3d..f4866d5 100644 --- a/gn3/settings.py +++ b/gn3/settings.py @@ -23,4 +23,4 @@ SQLALCHEMY_TRACK_MODIFICATIONS = False GN2_BASE_URL = "http://www.genenetwork.org/" # biweight script -BIWEIGHT_RSCRIPT = "~/genenetwork3/script/calculate_biweight.R" +BIWEIGHT_RSCRIPT = "~/genenetwork3/scripts/calculate_biweight.R" -- cgit v1.2.3