Mercurial > repos > iuc > sqlite_to_tabular
comparison macros.xml @ 13:c29d2f80a066 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 35576d64a12fa664d72559172c5960c09da2b632"
author | iuc |
---|---|
date | Thu, 19 Aug 2021 19:40:25 +0000 |
parents | 575cd6cd537c |
children | f768f6183386 |
comparison
equal
deleted
inserted
replaced
12:575cd6cd537c | 13:c29d2f80a066 |
---|---|
30 #set $filter_dict['action'] = str($fi.filter.regex_action) | 30 #set $filter_dict['action'] = str($fi.filter.regex_action) |
31 #silent $input_filters.append($filter_dict) | 31 #silent $input_filters.append($filter_dict) |
32 #elif $fi.filter.filter_type == 'select_columns': | 32 #elif $fi.filter.filter_type == 'select_columns': |
33 #set $filter_dict = dict() | 33 #set $filter_dict = dict() |
34 #set $filter_dict['filter'] = str($fi.filter.filter_type) | 34 #set $filter_dict['filter'] = str($fi.filter.filter_type) |
35 #set $filter_dict['columns'] = [int(str($ci).replace('c','')) for $ci in str($fi.filter.columns).split(',')] | 35 #set $filter_dict['columns'] = [int($c) for $c in str($fi.filter.columns).replace('c','').split(',')] |
36 #silent $input_filters.append($filter_dict) | |
37 #elif $fi.filter.filter_type == 'select_column_slices': | |
38 #set $filter_dict = dict() | |
39 #set $filter_dict['filter'] = str($fi.filter.filter_type) | |
40 #set $filter_dict['columns'] = [$c for $c in str($fi.filter.columns).split(',')] | |
36 #silent $input_filters.append($filter_dict) | 41 #silent $input_filters.append($filter_dict) |
37 #elif $fi.filter.filter_type == 'replace': | 42 #elif $fi.filter.filter_type == 'replace': |
38 #set $filter_dict = dict() | 43 #set $filter_dict = dict() |
39 #set $filter_dict['filter'] = str($fi.filter.filter_type) | 44 #set $filter_dict['filter'] = str($fi.filter.filter_type) |
40 #set $filter_dict['column'] = int(str($fi.filter.column).replace('c','')) | 45 #set $filter_dict['column'] = int(str($fi.filter.column).replace('c','')) |
50 #silent $input_filters.append($filter_dict) | 55 #silent $input_filters.append($filter_dict) |
51 #elif str($fi.filter.filter_type).endswith('pend_text'): | 56 #elif str($fi.filter.filter_type).endswith('pend_text'): |
52 #set $filter_dict = dict() | 57 #set $filter_dict = dict() |
53 #set $filter_dict['filter'] = str($fi.filter.filter_type) | 58 #set $filter_dict['filter'] = str($fi.filter.filter_type) |
54 #set $filter_dict['column_text'] = str($fi.filter.column_text) | 59 #set $filter_dict['column_text'] = str($fi.filter.column_text) |
60 #silent $input_filters.append($filter_dict) | |
61 #elif str($fi.filter.filter_type).endswith('pend_dataset_name'): | |
62 #set $filter_dict = dict() | |
63 #set $filter_dict['filter'] = str($fi.filter.filter_type).replace('dataset_name', 'text') | |
64 #set $filter_dict['column_text'] = $dataset_name | |
55 #silent $input_filters.append($filter_dict) | 65 #silent $input_filters.append($filter_dict) |
56 #elif $fi.filter.filter_type == 'normalize': | 66 #elif $fi.filter.filter_type == 'normalize': |
57 #set $filter_dict = dict() | 67 #set $filter_dict = dict() |
58 #set $filter_dict['filter'] = str($fi.filter.filter_type) | 68 #set $filter_dict['filter'] = str($fi.filter.filter_type) |
59 #set $filter_dict['columns'] = [int(str($ci).replace('c','')) for $ci in str($fi.filter.columns).split(',')] | 69 #set $filter_dict['columns'] = [int(str($ci).replace('c','')) for $ci in str($fi.filter.columns).split(',')] |
127 <param name="filter_type" type="select" label="Filter By"> | 137 <param name="filter_type" type="select" label="Filter By"> |
128 <option value="skip">skip leading lines</option> | 138 <option value="skip">skip leading lines</option> |
129 <option value="comment">comment char</option> | 139 <option value="comment">comment char</option> |
130 <option value="regex">by regex expression matching</option> | 140 <option value="regex">by regex expression matching</option> |
131 <option value="select_columns">select columns</option> | 141 <option value="select_columns">select columns</option> |
142 <option value="select_column_slices">select columns by indices/slices</option> | |
132 <option value="replace">regex replace value in column</option> | 143 <option value="replace">regex replace value in column</option> |
133 <option value="prepend_line_num">prepend a line number column</option> | 144 <option value="prepend_line_num">prepend a line number column</option> |
134 <option value="append_line_num">append a line number column</option> | 145 <option value="append_line_num">append a line number column</option> |
146 <option value="prepend_dataset_name">prepend a column with the dataset name</option> | |
147 <option value="append_dataset_name">append a column with the dataset name</option> | |
135 <option value="prepend_text">prepend a column with the given text</option> | 148 <option value="prepend_text">prepend a column with the given text</option> |
136 <option value="append_text">append a column with the given text</option> | 149 <option value="append_text">append a column with the given text</option> |
137 <option value="normalize">normalize list columns, replicates row for each item in list</option> | 150 <option value="normalize">normalize list columns, replicates row for each item in list</option> |
138 </param> | 151 </param> |
139 <when value="skip"> | 152 <when value="skip"> |
145 <expand macro="comment_char_options" /> | 158 <expand macro="comment_char_options" /> |
146 </param> | 159 </param> |
147 </when> | 160 </when> |
148 <when value="prepend_line_num"/> | 161 <when value="prepend_line_num"/> |
149 <when value="append_line_num"/> | 162 <when value="append_line_num"/> |
163 <when value="prepend_dataset_name"/> | |
164 <when value="append_dataset_name"/> | |
150 <when value="prepend_text"> | 165 <when value="prepend_text"> |
151 <param name="column_text" type="text" value="" label="text for column"> | 166 <param name="column_text" type="text" value="" label="text for column"> |
152 </param> | 167 </param> |
153 </when> | 168 </when> |
154 <when value="append_text"> | 169 <when value="append_text"> |
170 <param name="columns" type="text" value="" label="enter column numbers to keep" | 185 <param name="columns" type="text" value="" label="enter column numbers to keep" |
171 help="example: 1,4,2 or c1,c4,c2(selects the first,fourth, and second columns)"> | 186 help="example: 1,4,2 or c1,c4,c2(selects the first,fourth, and second columns)"> |
172 <validator type="regex" message="Column ordinal positions separated by commas">^(c?[1-9]\d*)(,c?[1-9]\d*)*$</validator> | 187 <validator type="regex" message="Column ordinal positions separated by commas">^(c?[1-9]\d*)(,c?[1-9]\d*)*$</validator> |
173 </param> | 188 </param> |
174 </when> | 189 </when> |
190 <when value="select_column_slices"> | |
191 <param name="columns" type="text" value="" label="enter indices or slices of the columns to keep"> | |
192 <help><![CDATA[ Python offset indexes or slices. Examples: | |
193 <ul> | |
194 <li>Column offset indexes: 0,3,1 (selects the first,fourth, and second columns)</li> | |
195 <li>Negative column numbers: -1,-2 (selects the last, and second last columns)</li> | |
196 <li>python slices ( slice(start, stop[, step]) select a range of columns): <li> | |
197 <ul> | |
198 <li>0:3 or :3 (selects the first 3 columns)</li> | |
199 <li>3:5 (selects the fourth and fifth columns)</li> | |
200 <li>2: (selects all columns after the second)</li> | |
201 <li>-2: (selects the last 2 columns)</li> | |
202 <li>2::-1 (selects the first 3 columns n reverse order: third,second,first)</li> | |
203 </ul> | |
204 </ul> | |
205 ]]></help> | |
206 <validator type="regex" message="Column ordinal positions separated by commas">^(-?[1-9]\d*|((-?\d+)?:(-?\d*(:-?\d*)?)))(,(-?[1-9]\d*|((-?\d+)?:(-?\d*(:-?\d*)?))))*$</validator> | |
207 </param> | |
208 </when> | |
209 | |
175 <when value="replace"> | 210 <when value="replace"> |
176 <param name="column" type="text" value="" label="enter column number to replace" | 211 <param name="column" type="text" value="" label="enter column number to replace" |
177 help="example: 1 or c1 (selects the first column)"> | 212 help="example: 1 or c1 (selects the first column)"> |
178 <validator type="regex" message="Column ordinal position">^(c?[1-9]\d*)$</validator> | 213 <validator type="regex" message="Column ordinal position">^(c?[1-9]\d*)$</validator> |
179 </param> | 214 </param> |
209 | 244 |
210 <token name="@LINEFILTERS_HELP@"> | 245 <token name="@LINEFILTERS_HELP@"> |
211 <![CDATA[ | 246 <![CDATA[ |
212 **Input Line Filters** | 247 **Input Line Filters** |
213 | 248 |
214 As a tabular file is being read, line filters may be applied. | 249 As a tabular file is being read, line filters may be applied: |
215 | 250 |
216 :: | 251 - skip leading lines - skip the first *number* of lines |
217 | 252 - comment char - omit any lines that start with the specified comment character |
218 - skip leading lines skip the first *number* of lines | 253 - by regex expression matching - *include/exclude* lines that match the regex expression |
219 - comment char omit any lines that start with the specified comment character | 254 - select columns - choose to include only selected columns in the order specified |
220 - by regex expression matching *include/exclude* lines the match the regex expression | 255 - select columns by indices/slices - *indices or slices* of the columns to keep (python_list_ indexing) |
221 - select columns choose to include only selected columns in the order specified | 256 - regex replace value in column - replace a field in a column using a regex substitution (good for date reformatting) |
222 - regex replace value in column replace a field in a column using a regex substitution (good for date reformatting) | 257 - regex replace value in column - add a new column using a regex substitution of a column value |
223 - regex replace value in column add a new column using a regex substitution of a column value | 258 - prepend a line number column - each line has the *ordinal* value of the line read by this filter as the first column |
224 - prepend a line number column each line has the ordinal value of the line read by this filter as the first column | 259 - append a line number column - each line has the *ordinal* value of the line read by this filter as the last column |
225 - append a line number column each line has the ordinal value of the line read by this filter as the last column | 260 - prepend a text column - each line has the text string as the first column |
226 - prepend a text column each line has the text string as the first column | 261 - append a text column - each line has the text string as the last column |
227 - append a text column each line has the text string as the last column | 262 - prepend the dataset name - each line has the *dataset name* as the first column |
228 - normalize list columns replicates the line for each item in the specified list *columns* | 263 - append the dataset name - each line has the *dataset name* as the last column |
264 - normalize list columns - replicates the line for each item in the specified list *columns* | |
265 | |
266 .. _python_list: https://docs.python.org/3/library/stdtypes.html#common-sequence-operations | |
229 ]]> | 267 ]]> |
230 </token> | 268 </token> |
231 | 269 |
232 <token name="@LINEFILTERS_HELP_EXAMPLE@"> | 270 <token name="@LINEFILTERS_HELP_EXAMPLE@"> |
233 <![CDATA[ | 271 <![CDATA[ |
282 2 Paula Brown 1978-05-24 Fluff cat 3 1 | 320 2 Paula Brown 1978-05-24 Fluff cat 3 1 |
283 1 Steven Jones 1974-04-04 Allie cat 4 2 | 321 1 Steven Jones 1974-04-04 Allie cat 4 2 |
284 0 Jane Doe 1978-05-24 5 3 | 322 0 Jane Doe 1978-05-24 5 3 |
285 1 James Smith 1980-10-20 Spot 6 4 | 323 1 James Smith 1980-10-20 Spot 6 4 |
286 | 324 |
287 Filter 6 - append a line number column: | 325 Filter 6 - select columns by indices/slices: '1:6' |
288 | 326 |
289 2 Paula Brown 1978-05-24 Rex dog 3 1 1 | 327 Paula Brown 1978-05-24 Rex dog |
290 2 Paula Brown 1978-05-24 Fluff cat 3 1 2 | 328 Paula Brown 1978-05-24 Fluff cat |
291 1 Steven Jones 1974-04-04 Allie cat 4 2 3 | 329 Steven Jones 1974-04-04 Allie cat |
292 0 Jane Doe 1978-05-24 5 3 4 | 330 Jane Doe 1978-05-24 |
293 1 James Smith 1980-10-20 Spot 6 4 5 | 331 James Smith 1980-10-20 Spot |
294 | 332 |
295 ]]> | 333 ]]> |
296 </token> | 334 </token> |
297 | 335 |
298 <token name="@QUERY_HELP@"> | 336 <token name="@QUERY_HELP@"> |