Mercurial > repos > iuc > dexseq
comparison dexseq_helper.py @ 0:276833129f97 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit eecb633ff51d61e8f94f580bb96053434029ab78-dirty
| author | iuc |
|---|---|
| date | Thu, 24 Sep 2015 17:16:56 -0400 |
| parents | |
| children | 28a2181df3b9 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:276833129f97 |
|---|---|
| 1 | |
| 2 from galaxy.tools.parameters import DataToolParameter | |
| 3 | |
| 4 def validate_input( trans, error_map, param_values, page_param_map ): | |
| 5 """ | |
| 6 Validates the user input, before execution. | |
| 7 """ | |
| 8 factors = param_values['rep_factorName'] | |
| 9 factor_name_list = [] | |
| 10 factor_duplication = False | |
| 11 level_duplication = False | |
| 12 | |
| 13 for factor in factors: | |
| 14 # factor names should be unique | |
| 15 fn = factor['factorName'] | |
| 16 if fn in factor_name_list: | |
| 17 factor_duplication = True | |
| 18 break | |
| 19 factor_name_list.append( fn ) | |
| 20 | |
| 21 level_name_list = list() | |
| 22 factor_index_list = list() | |
| 23 | |
| 24 for level in factor['rep_factorLevel']: | |
| 25 # level names under one factor should be unique | |
| 26 fl = level['factorLevel'] | |
| 27 if fl in level_name_list: | |
| 28 level_duplication = True | |
| 29 level_name_list.append( fl ) | |
| 30 | |
| 31 if level_duplication: | |
| 32 error_map['rep_factorName'] = [ dict() for t in factors ] | |
| 33 for i in range( len( factors ) ): | |
| 34 error_map['rep_factorName'][i]['rep_factorLevel'] = [ {'factorLevel': 'Factor levels for each factor need to be unique'} for t in factor['rep_factorLevel'] ] | |
| 35 break | |
| 36 | |
| 37 if factor_duplication: | |
| 38 error_map['rep_factorName'] = [ dict() for t in factors ] | |
| 39 for i in range( len( factors ) ): | |
| 40 error_map['rep_factorName'][i]['factorName'] = 'Factor names need to be unique.' | |
| 41 |
