view gerp_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 source

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/gerp/";
else:
    with open(kitDir + "/hgvs_annotate.loc", "r") as tsv:
        for line in csv.reader(tsv, delimiter="\t"):
            if line[0] == 'gerp_path':
                kitDir = line[1]

gerpDir = kitDir;
def GERP_fileOptions():
    list = os.listdir(gerpDir);
    list.sort()
    pattern = re.compile('.*\d+')
    fileOptions = [(s) for s in list if os.path.exists(gerpDir + s)]
    datasets = [(s, s, False) for s in fileOptions if pattern.match(s)]
    return datasets