Mercurial > repos > cmonjeau > stacks
comparison stacks.py @ 3:0e0ff9e9c761 default tip
fix inputs clean name
author | cmonjeau |
---|---|
date | Mon, 28 Sep 2015 13:21:35 +0000 |
parents | d6ba40f6c824 |
children |
comparison
equal
deleted
inserted
replaced
2:c9e10e0d6c10 | 3:0e0ff9e9c761 |
---|---|
33 | 33 |
34 tab_files=collections.OrderedDict() | 34 tab_files=collections.OrderedDict() |
35 for line in open(input_config, "r").readlines(): | 35 for line in open(input_config, "r").readlines(): |
36 if line.strip() != '': | 36 if line.strip() != '': |
37 extract=line.strip().split("::") | 37 extract=line.strip().split("::") |
38 tab_files[extract[0].replace(" (", ".").replace(" ", ".").replace(")", "").replace(":", ".").replace("/", ".")]=extract[1] | 38 tab_files[extract[0].replace("(", ".").replace(" ", ".").replace(")", "").replace(":", ".").replace("/", ".")]=extract[1] |
39 | 39 |
40 # tabfiles[name]-> path | 40 # tabfiles[name]-> path |
41 return tab_files | 41 return tab_files |
42 | 42 |
43 | 43 |
45 | 45 |
46 tab_files=collections.OrderedDict() | 46 tab_files=collections.OrderedDict() |
47 for line in open(input_config, "r").readlines(): | 47 for line in open(input_config, "r").readlines(): |
48 if line.strip() != '': | 48 if line.strip() != '': |
49 extract=line.strip().split("::") | 49 extract=line.strip().split("::") |
50 parse_name=re.search("^STACKS.*\((.*\.[ATCG]*\.fq)\)$", extract[0]) | 50 parse_name=re.search("STACKS.*\((.*\.[ATCG]*).*\)$", extract[0]) |
51 # rename galaxy name in a short name | 51 # rename galaxy name in a short name |
52 if parse_name: | 52 if parse_name: |
53 extract[0]=parse_name.groups(1)[0] | 53 extract[0]=parse_name.groups(1)[0] |
54 | 54 |
55 tab_files[extract[0].replace(" (", ".").replace(" ", ".").replace(")", "").replace(":", ".").replace("/", ".")]=extract[1] | 55 tab_files[extract[0].replace("(", ".").replace(" ", ".").replace(")", "").replace(":", ".").replace("/", ".")]=extract[1] |
56 | 56 |
57 # tabfiles[name]-> path | 57 # tabfiles[name]-> path |
58 return tab_files | 58 return tab_files |
59 | 59 |
60 | 60 |