Mercurial > repos > yusuf > hgvs_annotate
comparison polyphen_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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:40dd2e7ee63a |
---|---|
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/"; | |
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] == 'pathways_dbs': | |
18 kitDir = line[1] | |
19 | |
20 | |
21 polyPhenDir = kitDir | |
22 def PolyPhen_fileOptions(): | |
23 list = os.listdir(polyPhenDir); | |
24 list.sort() | |
25 pattern = re.compile('polyphen_(.*)\.txt.gz$') | |
26 fileOptions = [(s) for s in list if os.path.exists(polyPhenDir + s)] | |
27 ds = [pattern.match(s) for s in fileOptions] | |
28 datasets = [(m.group(1), m.group(1), False) for m in ds if m] | |
29 return datasets |