diff options
author | zsloan | 2018-01-04 14:10:02 -0600 |
---|---|---|
committer | GitHub | 2018-01-04 14:10:02 -0600 |
commit | 56065c9f994c9247eaa17e5216d44d0e5e733aa2 (patch) | |
tree | c0efbb873b77eeacdc6da7edc62a934c8088eced /wqflask/utility/tools.py | |
parent | f6ad049db84a83baad9bbf863244b174742380fc (diff) | |
parent | a2325f723052ff951200020f9b072a2dd5140c01 (diff) | |
download | genenetwork2-56065c9f994c9247eaa17e5216d44d0e5e733aa2.tar.gz |
Merge pull request #270 from pjotrp/testing
Merge some older commits
Diffstat (limited to 'wqflask/utility/tools.py')
-rw-r--r-- | wqflask/utility/tools.py | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index c5685cdd..57f97a81 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -105,7 +105,7 @@ def js_path(module=None): try_guix = get_setting("JS_GUIX_PATH")+"/"+module if valid_path(try_guix): return try_guix - raise "No JS path found for "+module+" (check JS_GN_PATH)" + raise "No JS path found for "+module+" (if not in Guix check JS_GN_PATH)" def pylmm_command(guess=None): return assert_bin(get_setting("PYLMM_COMMAND",guess)) @@ -147,9 +147,14 @@ def assert_writable_dir(dir): fh.close() os.remove(fn) except IOError: - raise Exception('Unable to write test.txt to directory ' + dir ) + raise Exception('Unable to write test.txt to directory ' + dir) return dir +def assert_file(fn): + if not valid_file(fn): + raise Exception('Unable to find file '+fn) + return fn + def mk_dir(dir): if not valid_path(dir): os.makedirs(dir) @@ -174,6 +179,9 @@ def locate(name, subdir=None): if subdir: sys.stderr.write(subdir) raise Exception("Can not locate "+name+" in "+base) +def locate_phewas(name, subdir=None): + return locate(name,'/phewas/'+subdir) + def locate_ignore_error(name, subdir=None): """ Locate a static flat file in the GENENETWORK_FILES environment. @@ -239,15 +247,16 @@ USE_GN_SERVER = get_setting_bool('USE_GN_SERVER') GENENETWORK_FILES = get_setting('GENENETWORK_FILES') JS_GUIX_PATH = get_setting('JS_GUIX_PATH') -# assert_dir(JS_GUIX_PATH) - don't enforce right now +assert_dir(JS_GUIX_PATH) JS_GN_PATH = get_setting('JS_GN_PATH') # assert_dir(JS_GN_PATH) -PYLMM_COMMAND = pylmm_command() -GEMMA_COMMAND = gemma_command() +PYLMM_COMMAND = app_set("PYLMM_COMMAND",pylmm_command()) +GEMMA_COMMAND = app_set("GEMMA_COMMAND",gemma_command()) +PLINK_COMMAND = app_set("PLINK_COMMAND",plink_command()) GEMMA_WRAPPER_COMMAND = gemma_wrapper_command() -PLINK_COMMAND = plink_command() -TEMPDIR = tempdir() # defaults to UNIX TMPDIR +TEMPDIR = tempdir() # defaults to UNIX TMPDIR +assert_dir(TEMPDIR) # ---- Handle specific JS modules JS_TWITTER_POST_FETCHER_PATH = get_setting("JS_TWITTER_POST_FETCHER_PATH",js_path("Twitter-Post-Fetcher")) @@ -267,3 +276,10 @@ if os.environ.get('WQFLASK_OVERRIDES'): else: OVERRIDES[k] = cmd logger.debug(OVERRIDES) + +# assert_file(PHEWAS_FILES+"/auwerx/PheWAS_pval_EMMA_norm.RData") +# assert_dir(get_setting("JS_BIODALLIANCE")) +# assert_file(get_setting("JS_BIODALLIANCE")+"/build/dalliance-all.js") +# assert_file(get_setting("JS_BIODALLIANCE")+"/build/worker-all.js") +# assert_dir(get_setting("JS_TWITTER_POST_FETCHER")) +assert_file(JS_TWITTER_POST_FETCHER_PATH+"/js/twitterFetcher_min.js") |