annotate dexseq_helper.py @ 0:4ca0e679f21e draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
author iuc
date Thu, 08 Oct 2015 16:52:01 -0400
parents
children f1c406f9554c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
1
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
2 from galaxy.tools.parameters import DataToolParameter
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
3
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
4 def validate_input( trans, error_map, param_values, page_param_map ):
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
5 """
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
6 Validates the user input, before execution.
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
7 """
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
8 factors = param_values['rep_factorName']
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
9 factor_name_list = []
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
10 factor_duplication = False
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
11 level_duplication = False
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
12
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
13 for factor in factors:
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
14 # factor names should be unique
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
15 fn = factor['factorName']
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
16 if fn in factor_name_list:
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
17 factor_duplication = True
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
18 break
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
19 factor_name_list.append( fn )
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
20
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
21 level_name_list = list()
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
22 factor_index_list = list()
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
23
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
24 for level in ['factorLevel1', 'factorLevel2']:
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
25 # level names under one factor should be unique
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
26 fl = factor[level]
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
27 if fl in level_name_list:
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
28 level_duplication = True
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
29 level_name_list.append( fl )
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
30
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
31 if level_duplication:
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
32 error_map['rep_factorName'] = [ dict() for t in factors ]
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
33 for i in range( len( factors ) ):
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
34 error_map['rep_factorName'][i]['FactorLevel1'] = [ {'factorLevel': 'Factor levels for each factor need to be unique'} for t in [factor['factorLevel1'], factor['factorLevel2']] ]
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
35 break
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
36
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
37 if factor_duplication:
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
38 error_map['rep_factorName'] = [ dict() for t in factors ]
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
39 for i in range( len( factors ) ):
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
40 error_map['rep_factorName'][i]['factorName'] = 'Factor names need to be unique.'
4ca0e679f21e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 876fc32b23d3b9c378ddbfbbba27d37d22576c85
iuc
parents:
diff changeset
41