Mercurial > repos > yusuf > hgvs_annotate
diff tissuedist_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/tissuedist_datasets.py Wed Mar 25 16:00:12 2015 -0600 @@ -0,0 +1,28 @@ +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/"; +else: + with open(kitDir + "/hgvs_annotate.loc", "r") as tsv: + for line in csv.reader(tsv, delimiter="\t"): + if line[0] == 'pathways_dbs': + kitDir = line[1] + +tissueDir = kitDir +def TissueDist_fileOptions(): + list = os.listdir(tissueDir); + list.sort() + pattern = re.compile('tissue_dist_(v\d\d\d\d-\d\d-\d\d)\.tab$') + fileOptions = [(s) for s in list if os.path.exists(tissueDir + s)] + ds = [pattern.match(s) for s in fileOptions] + datasets = [(m.group(1), m.group(1), False) for m in ds if m] + return datasets