comparison dexseq_helper.py @ 13:3762d6644ec4 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 06f2c57b523aab7c997d82e1345fd23f178de598"
author iuc
date Fri, 19 Mar 2021 09:44:32 +0000
parents 469c0d7489bd
children
comparison
equal deleted inserted replaced
12:b7832fe12799 13:3762d6644ec4
1 def validate_input( trans, error_map, param_values, page_param_map ): 1 def validate_input(trans, error_map, param_values, page_param_map):
2 """ 2 """
3 Validates the user input, before execution. 3 Validates the user input, before execution.
4 """ 4 """
5 factors = param_values['rep_factorName'] 5 factors = param_values['rep_factorName']
6 factor_name_list = [] 6 factor_name_list = []
11 # factor names should be unique 11 # factor names should be unique
12 fn = factor['factorName'] 12 fn = factor['factorName']
13 if fn in factor_name_list: 13 if fn in factor_name_list:
14 factor_duplication = True 14 factor_duplication = True
15 break 15 break
16 factor_name_list.append( fn ) 16 factor_name_list.append(fn)
17 17
18 level_name_list = list() 18 level_name_list = list()
19 19
20 for level in ['factorLevel1', 'factorLevel2']: 20 for level in ['factorLevel1', 'factorLevel2']:
21 # level names under one factor should be unique 21 # level names under one factor should be unique
22 fl = factor[level] 22 fl = factor[level]
23 if fl in level_name_list: 23 if fl in level_name_list:
24 level_duplication = True 24 level_duplication = True
25 level_name_list.append( fl ) 25 level_name_list.append(fl)
26 26
27 if level_duplication: 27 if level_duplication:
28 error_map['rep_factorName'] = [ dict() for t in factors ] 28 error_map['rep_factorName'] = [dict() for t in factors]
29 for i in range( len( factors ) ): 29 for i in range(len(factors)):
30 error_map['rep_factorName'][i]['FactorLevel1'] = [ {'factorLevel': 'Factor levels for each factor need to be unique'} for t in [factor['factorLevel1'], factor['factorLevel2']] ] 30 error_map['rep_factorName'][i]['FactorLevel1'] = [{'factorLevel': 'Factor levels for each factor need to be unique'} for t in [factor['factorLevel1'], factor['factorLevel2']]]
31 break 31 break
32 32
33 if factor_duplication: 33 if factor_duplication:
34 error_map['rep_factorName'] = [ dict() for t in factors ] 34 error_map['rep_factorName'] = [dict() for t in factors]
35 for i in range( len( factors ) ): 35 for i in range(len(factors)):
36 error_map['rep_factorName'][i]['factorName'] = 'Factor names need to be unique.' 36 error_map['rep_factorName'][i]['factorName'] = 'Factor names need to be unique.'