Mercurial > repos > iuc > dexseq
annotate dexseq_helper.py @ 11:9a7c5b6d8f1e draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 0ccfadf8ac4bc6514836c4efe6f605973a08d1ed
author | iuc |
---|---|
date | Tue, 02 Apr 2024 12:59:54 +0000 |
parents | 62adf13b86ea |
children |
rev | line source |
---|---|
7
62adf13b86ea
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 06f2c57b523aab7c997d82e1345fd23f178de598"
iuc
parents:
1
diff
changeset
|
1 def validate_input(trans, error_map, param_values, page_param_map): |
1
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
2 """ |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
3 Validates the user input, before execution. |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
4 """ |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
5 factors = param_values['rep_factorName'] |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
6 factor_name_list = [] |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
7 factor_duplication = False |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
8 level_duplication = False |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
9 |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
10 for factor in factors: |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
11 # factor names should be unique |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
12 fn = factor['factorName'] |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
13 if fn in factor_name_list: |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
14 factor_duplication = True |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
15 break |
7
62adf13b86ea
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 06f2c57b523aab7c997d82e1345fd23f178de598"
iuc
parents:
1
diff
changeset
|
16 factor_name_list.append(fn) |
1
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
17 |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
18 level_name_list = list() |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
19 |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
20 for level in ['factorLevel1', 'factorLevel2']: |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
21 # level names under one factor should be unique |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
22 fl = factor[level] |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
23 if fl in level_name_list: |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
24 level_duplication = True |
7
62adf13b86ea
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 06f2c57b523aab7c997d82e1345fd23f178de598"
iuc
parents:
1
diff
changeset
|
25 level_name_list.append(fl) |
1
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
26 |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
27 if level_duplication: |
7
62adf13b86ea
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 06f2c57b523aab7c997d82e1345fd23f178de598"
iuc
parents:
1
diff
changeset
|
28 error_map['rep_factorName'] = [dict() for t in factors] |
62adf13b86ea
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 06f2c57b523aab7c997d82e1345fd23f178de598"
iuc
parents:
1
diff
changeset
|
29 for i in range(len(factors)): |
62adf13b86ea
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 06f2c57b523aab7c997d82e1345fd23f178de598"
iuc
parents:
1
diff
changeset
|
30 error_map['rep_factorName'][i]['FactorLevel1'] = [{'factorLevel': 'Factor levels for each factor need to be unique'} for t in [factor['factorLevel1'], factor['factorLevel2']]] |
1
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
31 break |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
32 |
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
33 if factor_duplication: |
7
62adf13b86ea
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 06f2c57b523aab7c997d82e1345fd23f178de598"
iuc
parents:
1
diff
changeset
|
34 error_map['rep_factorName'] = [dict() for t in factors] |
62adf13b86ea
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 06f2c57b523aab7c997d82e1345fd23f178de598"
iuc
parents:
1
diff
changeset
|
35 for i in range(len(factors)): |
1
f1c406f9554c
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 93f63600a8d492e6c9006c1426fbae84de5ca232
iuc
parents:
0
diff
changeset
|
36 error_map['rep_factorName'][i]['factorName'] = 'Factor names need to be unique.' |