aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2018-02-10 08:53:27 +0000
committerPjotr Prins2018-02-10 08:53:27 +0000
commit91365baf9ba657f56c19201874cdf60aede75dd1 (patch)
tree33f9f0069b177d41423004d6f2eff471b56f273a
parentb3d9c748008d401ca5b5fa5d60a6a1eff505ee3e (diff)
downloadgenenetwork2-91365baf9ba657f56c19201874cdf60aede75dd1.tar.gz
Fixing GEMMA LOCO
-rwxr-xr-xbin/genenetwork24
-rw-r--r--wqflask/wqflask/marker_regression/gemma_mapping.py11
2 files changed, 11 insertions, 4 deletions
diff --git a/bin/genenetwork2 b/bin/genenetwork2
index 7148c022..52144f4d 100755
--- a/bin/genenetwork2
+++ b/bin/genenetwork2
@@ -121,7 +121,9 @@ else
export PLINK_COMMAND="$GN2_PROFILE/bin/plink2"
export PYLMM_COMMAND="$GN2_PROFILE/bin/pylmm_redis"
export GEMMA_COMMAND="$GN2_PROFILE/bin/gemma"
- export GEMMA_WRAPPER_COMMAND="$GN2_PROFILE/bin/gemma-wrapper"
+ if [ -z GEMMA_WRAPPER_COMMAND ]; then
+ export GEMMA_WRAPPER_COMMAND="$GN2_PROFILE/bin/gemma-wrapper"
+ fi
if [ ! -d $PYTHONPATH ] ; then echo "PYTHONPATH not valid "$PYTHONPATH ; exit 1 ; fi
if [ ! -d $R_LIBS_SITE ] ; then echo "R_LIBS_SITE not valid "$R_LIBS_SITE ; exit 1 ; fi
if [ ! -d $GEM_PATH ] ; then echo "GEM_PATH not valid "$GEM_PATH ; exit 1 ; fi
diff --git a/wqflask/wqflask/marker_regression/gemma_mapping.py b/wqflask/wqflask/marker_regression/gemma_mapping.py
index c004983e..68920130 100644
--- a/wqflask/wqflask/marker_regression/gemma_mapping.py
+++ b/wqflask/wqflask/marker_regression/gemma_mapping.py
@@ -3,7 +3,7 @@ import os, math, string, random, json
from base import webqtlConfig
from base.trait import GeneralTrait
from base.data_set import create_dataset
-from utility.tools import flat_files, GEMMA_COMMAND, GEMMA_WRAPPER_COMMAND, TEMPDIR, assert_bin
+from utility.tools import flat_files, GEMMA_COMMAND, GEMMA_WRAPPER_COMMAND, TEMPDIR, assert_bin, assert_file
import utility.logger
logger = utility.logger.getLogger(__name__ )
@@ -210,8 +210,13 @@ def parse_gemma_output(genofile_name):
def parse_loco_output(this_dataset, gwa_output_filename):
output_filelist = []
- with open("{}/gn2/".format(TEMPDIR) + gwa_output_filename + ".json") as data_file:
- data = json.load(data_file)
+ jsonfn = "{}/gn2/".format(TEMPDIR) + gwa_output_filename + ".json"
+ assert_file(jsonfn)
+ try:
+ with open(jsonfn) as data_file:
+ data = json.load(data_file)
+ except:
+ logger.error("Can not parse "+jsonfn)
files = data['files']
for file in files: