0
|
1 import os
|
|
2 import re
|
|
3 import csv
|
|
4 import operator
|
|
5 from galaxy import config
|
|
6
|
|
7 # get tool-data path
|
|
8 configur = config.Configuration()
|
|
9 kitDir = configur.resolve_path("tool-data")
|
|
10
|
|
11 # determine if config file exists
|
|
12 if not os.path.exists( kitDir + "/hgvs_annotate.loc" ):
|
|
13 kitDir = "/export/geno_tmp/achri/dbs/gerp/";
|
|
14 else:
|
|
15 with open(kitDir + "/hgvs_annotate.loc", "r") as tsv:
|
|
16 for line in csv.reader(tsv, delimiter="\t"):
|
|
17 if line[0] == 'gerp_path':
|
|
18 kitDir = line[1]
|
|
19
|
|
20 gerpDir = kitDir;
|
|
21 def GERP_fileOptions():
|
|
22 list = os.listdir(gerpDir);
|
|
23 list.sort()
|
|
24 pattern = re.compile('.*\d+')
|
|
25 fileOptions = [(s) for s in list if os.path.exists(gerpDir + s)]
|
|
26 datasets = [(s, s, False) for s in fileOptions if pattern.match(s)]
|
|
27 return datasets
|