diff sift_datasets.py @ 0:40dd2e7ee63a default tip

initial commit
author Yusuf Ali <ali@yusuf.email>
date Wed, 25 Mar 2015 16:00:12 -0600
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sift_datasets.py	Wed Mar 25 16:00:12 2015 -0600
@@ -0,0 +1,27 @@
+import os
+import re
+import csv
+import operator
+from galaxy import config
+
+# get tool-data path
+configur =  config.Configuration()
+kitDir = configur.resolve_path("tool-data")
+
+# determine if config file exists
+if not os.path.exists( kitDir +  "/hgvs_annotate.loc" ):
+    kitDir = "/export/geno_tmp/achri/dbs/sift/"
+	 else:
+	 with open(kitDir + "/hgvs_annotate.loc", "r") as tsv:
+	   for line in csv.reader(tsv, delimiter="\t"):
+		    if line[0] == 'sift_dir':
+			       kitDir = line[1]
+
+siftDir = kitDir
+def SIFT_fileOptions():
+    list = os.listdir(siftDir);
+    list.sort()
+    pattern = re.compile('.*\d+')
+    fileOptions = [(s) for s in list if os.path.exists(siftDir + s)]
+    datasets = [(s, s, False) for s in fileOptions if pattern.match(s)]
+    return datasets