aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
authorPjotr Prins2016-02-23 11:16:33 +0000
committerPjotr Prins2016-04-20 09:00:21 +0000
commit218fd0c7666583748098f0b7b4286b6d1cbf6838 (patch)
treea711ba23d6036ebcd8c33e322d6f45592993d473 /wqflask/base
parenta5ff6520ad29266e1647ce54ad6b2c0f200dfe9a (diff)
downloadgenenetwork2-218fd0c7666583748098f0b7b4286b6d1cbf6838.tar.gz
[PATCH 033/100] Refactored file searching
Diffstat (limited to 'wqflask/base')
-rwxr-xr-xwqflask/base/data_set.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 9ffc09ac..ce13dd77 100755
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -44,7 +44,7 @@ from dbFunction import webqtlDatabaseFunction
from utility import webqtlUtil
from utility.benchmark import Bench
from utility import chunks
-from utility.tools import locate
+from utility.tools import locate, locate_without_error
from maintenance import get_group_samplelists
@@ -405,15 +405,15 @@ class DatasetGroup(object):
else:
print("Cache not hit")
- geno_file_path = locate(self.name+".geno",'genotype')
- mapping_file_path = locate(self.name+".fam",'mapping')
- if os.path.isfile(mapping_file_path):
- self.samplelist = get_group_samplelists.get_samplelist("plink", mapping_file_path)
- elif os.path.isfile(geno_file_path):
- self.samplelist = get_group_samplelists.get_samplelist("geno", geno_file_path)
+ genotype_fn = locate_without_error(self.name+".geno",'genotype')
+ mapping_fn = locate_without_error(self.name+".fam",'mapping')
+ if mapping_fn:
+ self.samplelist = get_group_samplelists.get_samplelist("plink", mapping_fn)
+ elif genotype_fn:
+ self.samplelist = get_group_samplelists.get_samplelist("geno", genotype_fn)
else:
self.samplelist = None
- #print("after get_samplelist")
+ print("Sample list: ",self.samplelist)
Redis.set(key, json.dumps(self.samplelist))
Redis.expire(key, 60*5)