aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility
diff options
context:
space:
mode:
authorzsloan2015-07-09 19:29:30 +0000
committerzsloan2015-07-09 19:29:30 +0000
commit83ff8ce678f15f2f6003a5800a75166544d7c6fa (patch)
tree63af8dcc71f4f2709ac2af2029a7471fd46597dc /wqflask/utility
parent25b1d4c4aad2d44e0ff6bfa5aade1783b7a63120 (diff)
downloadgenenetwork2-83ff8ce678f15f2f6003a5800a75166544d7c6fa.tar.gz
Mapping methods now check for existing genotype files.
Currently we still usually get our samplelists from the genofile. This is dumb because it results in us having a bunch of "dummy" genofiles for certain data sets (seems to be mostly human ones). This means that checking for the genofile alone isn't enough to determine if a mapping method should exist for a given group I wrote some code that will instead get the samplelist from the plink .fam file for some of these groups/datasets (if the .fam file exists). Ideally I would like to remove all of the dummy .geno files, but we can't yet do so because it's currently the only place we seem to be storing the sample list for some groups. I also moved gemma into the plink directory to get it out of the git tree. Since it uses the same files as plink, it doesn't make sense for it to be in its own separate directory
Diffstat (limited to 'wqflask/utility')
-rw-r--r--wqflask/utility/tools.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index 6e35f00a..760ded7c 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -66,4 +66,19 @@ def plink_command(default=None):
guess = os.environ.get('HOME')+'/plink'
path = get_setting('PLINK_PATH',default,guess,get_valid_path)
plink_command = path+'/plink'
- return path,plink_command \ No newline at end of file
+ return path,plink_command
+
+def gemma_command(default=None):
+ def get_valid_path(path):
+ """Test for a valid repository"""
+ if path:
+ sys.stderr.write("Trying PLINK_PATH in "+path+"\n")
+ if path and os.path.isfile(path+'/plink'):
+ return path
+ else:
+ None
+
+ guess = os.environ.get('HOME')+'/plink'
+ path = get_setting('PLINK_PATH',default,guess,get_valid_path)
+ gemma_command = path+'/gemma'
+ return path, gemma_command \ No newline at end of file