Mercurial > repos > yusuf > depth_report
comparison capture_kits.py @ 1:a0f4b5618eee default tip
abstracted capture kits
| author | Yusuf Ali <ali@yusuf.email> | 
|---|---|
| date | Wed, 25 Mar 2015 15:47:16 -0600 | 
| parents | |
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| 0:6b2e640c8c6d | 1:a0f4b5618eee | 
|---|---|
| 1 import os | |
| 2 import re | |
| 3 import sys | |
| 4 import operator | |
| 5 import csv | |
| 6 from galaxy import config | |
| 7 | |
| 8 # get tool-data path | |
| 9 configur = config.Configuration() | |
| 10 kitDir = configur.resolve_path("tool-data") | |
| 11 | |
| 12 # determine if config file exists | |
| 13 if not os.path.exists( kitDir + "/depth_report.loc" ): | |
| 14 kitDir = "/export/achri_galaxy/dbs/CaptureKits/"; | |
| 15 else: | |
| 16 with open(kitDir + "/depth_report.loc", "r") as tsv: | |
| 17 for line in csv.reader(tsv, delimiter="\t"): | |
| 18 if line[0] == 'capture_kits_dir': | |
| 19 kitDir = line[1] | |
| 20 | |
| 21 def kit_fileOptions(): | |
| 22 list = os.listdir(kitDir); | |
| 23 list.sort() | |
| 24 pattern = re.compile('(.*)$') | |
| 25 fileOptions = [(s) for s in list if os.path.exists(kitDir + s)] | |
| 26 ds = [pattern.match(s) for s in fileOptions] | |
| 27 datasets = [(m.group(1), m.group(1), False) for m in ds if m] | |
| 28 return datasets | |
| 29 | 
