aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2016-04-20 08:51:57 +0000
committerPjotr Prins2016-04-20 08:51:57 +0000
commit1675f34eeff84d7ec0f43c1676f9107e202dda88 (patch)
tree7640f085774eb774d49b463f54d4251be6ad4d75
parent3be9e4a0950b1ea2d560463032c6f4104baf738e (diff)
downloadgenenetwork2-1675f34eeff84d7ec0f43c1676f9107e202dda88.tar.gz
[PATCH 027/100] Introduce tools.locate
-rw-r--r--wqflask/utility/tools.py14
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression.py5
2 files changed, 15 insertions, 4 deletions
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index 5d69e699..624df179 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -78,11 +78,23 @@ def flat_files(subdir=None):
return valid_path(base+"/"+subdir)
return valid_path(base)
+def locate(name, subdir=None):
+ base = get_setting("GENENETWORK_FILES")
+ if subdir:
+ base = base+"/"+subdir
+ if valid_path(base):
+ lookfor = base + "/" + name
+ if valid_path(lookfor):
+ return lookfor
+ else:
+ raise IOError("Can not locate "+lookfor)
+ raise IOError("Can not locate "+name)
+
def tempdir():
return valid_path(get_setting("TEMPDIR","/tmp"))
+
# Cached values
-
PYLMM_COMMAND = pylmm_command()
GEMMA_COMMAND = pylmm_command()
PLINK_COMMAND = pylmm_command()
diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py
index a76a5967..36334317 100644
--- a/wqflask/wqflask/marker_regression/marker_regression.py
+++ b/wqflask/wqflask/marker_regression/marker_regression.py
@@ -41,7 +41,7 @@ from wqflask.marker_regression import gemma_mapping
#from wqflask.marker_regression import plink_mapping
#from wqflask.marker_regression import rqtl_mapping
-from utility.tools import PYLMM_COMMAND, GEMMA_COMMAND, PLINK_COMMAND
+from utility.tools import locate, PYLMM_COMMAND, GEMMA_COMMAND, PLINK_COMMAND
class MarkerRegression(object):
@@ -979,8 +979,7 @@ class MarkerRegression(object):
#def gen_human_results(self, pheno_vector, tempdata):
def gen_human_results(self, pheno_vector, key, temp_uuid):
- file_base = os.path.join(webqtlConfig.PYLMM_PATH, self.dataset.group.name)
- print("file_base:", file_base)
+ file_base = locate(self.dataset.group.name,"mapping")
plink_input = input.plink(file_base, type='b')
input_file_name = os.path.join(webqtlConfig.SNP_PATH, self.dataset.group.name + ".snps.gz")