Mercurial > repos > yusuf > depth_report
changeset 1:a0f4b5618eee default tip
abstracted capture kits
author | Yusuf Ali <ali@yusuf.email> |
---|---|
date | Wed, 25 Mar 2015 15:47:16 -0600 |
parents | 6b2e640c8c6d |
children | |
files | capture_kits.py |
diffstat | 1 files changed, 29 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/capture_kits.py Wed Mar 25 15:47:16 2015 -0600 @@ -0,0 +1,29 @@ +import os +import re +import sys +import operator +import csv +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 + "/depth_report.loc" ): + kitDir = "/export/achri_galaxy/dbs/CaptureKits/"; +else: + with open(kitDir + "/depth_report.loc", "r") as tsv: + for line in csv.reader(tsv, delimiter="\t"): + if line[0] == 'capture_kits_dir': + kitDir = line[1] + +def kit_fileOptions(): + list = os.listdir(kitDir); + list.sort() + pattern = re.compile('(.*)$') + fileOptions = [(s) for s in list if os.path.exists(kitDir + 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 +