Mercurial > repos > yusuf > poor_gene_coverage
comparison capture_kits.py @ 0:7cdd13ff182a default tip
initial commit
author | Yusuf Ali <ali@yusuf.email> |
---|---|
date | Wed, 25 Mar 2015 15:49:28 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7cdd13ff182a |
---|---|
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 + "/report_poor_coverage" ): | |
14 kitDir = "/export/achri_galaxy/dbs/CaptureKits/"; | |
15 else: | |
16 with open(kitDir + "/report_poor_coverage", "r") as tsv: | |
17 for line in csv.reader(tsv, delimiter="\t"): | |
18 if line[0] == 'capturekits_directory': | |
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 |