diff options
author | BonfaceKilz | 2021-06-23 14:07:52 +0300 |
---|---|---|
committer | GitHub | 2021-06-23 14:07:52 +0300 |
commit | a45f1fd15a5adfab1f284af15349175b7f765296 (patch) | |
tree | 9beb98989133c8ef87ab0cde33a9773b8298cac2 /gn3 | |
parent | 3cc3cf68c2dcbdc2cd496f8e2728a59fbb6614e6 (diff) | |
parent | 7b602a681dc3fefbe322037545d07389ef194920 (diff) | |
download | genenetwork3-a45f1fd15a5adfab1f284af15349175b7f765296.tar.gz |
Merge pull request #21 from genenetwork/fix/biweight-errors
Fix/biweight errors
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/computations/biweight.py | 10 | ||||
-rw-r--r-- | gn3/settings.py | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/gn3/computations/biweight.py b/gn3/computations/biweight.py index 6d031ad..7accd0c 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 error: + raise error 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" |