Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/galaxy/util/rules_dsl_spec.yml @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author | shellac |
---|---|
date | Mon, 22 Mar 2021 18:12:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4f3585e2f14b |
---|---|
1 - doc: add_column_basename functions properly on absolute and relative paths | |
2 rules: | |
3 - type: add_column_basename | |
4 target_column: 0 | |
5 initial: | |
6 data: [['/path/to/moo.txt'], ['moo.txt']] | |
7 sources: [1, 2] | |
8 final: | |
9 data: | |
10 - [/path/to/moo.txt, moo.txt] | |
11 - [moo.txt, moo.txt] | |
12 - doc: add_column_regex works with simple captures by default | |
13 rules: | |
14 - type: add_column_regex | |
15 target_column: 0 | |
16 expression: '(o)+' | |
17 initial: | |
18 data: [[foo], [cow]] | |
19 sources: [1,2] | |
20 final: | |
21 data: [[foo, oo], [cow, o]] | |
22 - doc: add_column_regex works with replacements if supplied | |
23 rules: | |
24 - type: add_column_regex | |
25 target_column: 0 | |
26 expression: '(o+)' | |
27 replacement: 'the os \1' | |
28 initial: | |
29 data: [[foo], [cow]] | |
30 sources: [1,2] | |
31 final: | |
32 data: [["foo", "the os oo"], ["cow", "the os o"]] | |
33 - doc: add_column_regex works with multiple groups when group_count specified | |
34 rules: | |
35 - type: add_column_regex | |
36 target_column: 0 | |
37 expression: '.*(o)(o)' | |
38 group_count: 2 | |
39 initial: | |
40 data: [[foo], [boo]] | |
41 sources: [1,2] | |
42 final: | |
43 data: [["foo", "o", "o"], ["boo", "o", "o"]] | |
44 - doc: add_column_substr works for keeping a fixed length prefix | |
45 rules: | |
46 - type: add_column_substr | |
47 target_column: 0 | |
48 substr_type: keep_prefix | |
49 length: 2 | |
50 initial: | |
51 data: [[foo], [cow], [ba], [d]] | |
52 sources: [1, 2] | |
53 final: | |
54 data: [[foo, fo], [cow, co], [ba, ba], [d, d]] | |
55 - doc: add_column_substr works for keeping a fixed length suffix | |
56 rules: | |
57 - type: add_column_substr | |
58 target_column: 0 | |
59 substr_type: keep_suffix | |
60 length: 2 | |
61 initial: | |
62 data: [[foo], [cow], [ba], [d]] | |
63 sources: [1, 2] | |
64 final: | |
65 data: [[foo, oo], [cow, ow], [ba, ba], [d, d]] | |
66 - doc: add_column_substr works for dropping a fixed length prefix | |
67 rules: | |
68 - type: add_column_substr | |
69 target_column: 0 | |
70 substr_type: drop_prefix | |
71 length: 2 | |
72 initial: | |
73 data: [[foo], [cow], [ba], [d]] | |
74 sources: [1, 2] | |
75 final: | |
76 data: [[foo, o], [cow, w], [ba, ""], [d, ""]] | |
77 - doc: add_column_substr works for dropping a fixed length suffix | |
78 rules: | |
79 - type: add_column_substr | |
80 target_column: 0 | |
81 substr_type: drop_suffix | |
82 length: 2 | |
83 initial: | |
84 data: [[foo], [cow], [ba], [d]] | |
85 sources: [1, 2] | |
86 final: | |
87 data: [[foo, f], [cow, c], [ba, ""], [d, ""]] | |
88 - rules: | |
89 - type: add_column_rownum | |
90 start: 1 | |
91 initial: | |
92 data: [[foo], [cow], [ba], [d]] | |
93 sources: [1, 2, 3, 4] | |
94 final: | |
95 data: [[foo, "1"], [cow, "2"], [ba, "3"], [d, "4"]] | |
96 - rules: | |
97 - type: add_column_rownum | |
98 start: 0 | |
99 initial: | |
100 data: [[foo], [cow], [ba], [d]] | |
101 sources: [1, 2, 3, 4] | |
102 final: | |
103 data: [[foo, "0"], [cow, "1"], [ba, "2"], [d, "3"]] | |
104 - rules: | |
105 - type: add_column_value | |
106 value: "moo" | |
107 initial: | |
108 data: [[foo], [cow]] | |
109 sources: [1, 2] | |
110 final: | |
111 data: [[foo, moo], [cow, moo]] | |
112 - rules: | |
113 - type: remove_columns | |
114 target_columns: [0, 1] | |
115 initial: | |
116 data: [[a, b, c], [e, f, g]] | |
117 sources: [1, 2] | |
118 final: | |
119 data: [[c], [g]] | |
120 - rules: | |
121 - type: remove_columns | |
122 target_columns: [2] | |
123 initial: | |
124 data: [[a, b, c], [e, f, g]] | |
125 sources: [1, 2] | |
126 final: | |
127 data: [[a, b], [e, f]] | |
128 - rules: | |
129 - type: add_filter_regex | |
130 target_column: 0 | |
131 expression: '(a+)' | |
132 invert: false | |
133 initial: | |
134 data: [[a, b, c], [e, f, g]] | |
135 sources: [1, 2] | |
136 final: | |
137 data: [[a, b, c]] | |
138 - rules: | |
139 - type: add_filter_regex | |
140 target_column: 2 | |
141 expression: '(c+)' | |
142 invert: true | |
143 initial: | |
144 data: [[a, b, c], [e, f, g]] | |
145 sources: [1, 2] | |
146 final: | |
147 data: [[e, f, g]] | |
148 sources: [2] | |
149 - rules: | |
150 - type: add_filter_count | |
151 count: 1 | |
152 which: first | |
153 invert: false | |
154 initial: | |
155 data: [[a, b, c], [e, f, g], [h, i, j]] | |
156 sources: [1, 2, 3] | |
157 final: | |
158 data: [[e, f, g], [h, i, j]] | |
159 sources: [2, 3] | |
160 - rules: | |
161 - type: add_filter_count | |
162 count: 0 | |
163 which: first | |
164 invert: false | |
165 initial: | |
166 data: [[a, b, c], [e, f, g], [h, i, j]] | |
167 sources: [1, 2, 3] | |
168 final: | |
169 data: [[a, b, c], [e, f, g], [h, i, j]] | |
170 sources: [1, 2, 3] | |
171 - rules: | |
172 - type: add_filter_count | |
173 count: 1 | |
174 which: last | |
175 invert: false | |
176 initial: | |
177 data: [[a, b, c], [e, f, g], [h, i, j]] | |
178 sources: [1, 2, 3] | |
179 final: | |
180 data: [[a, b, c], [e, f, g]] | |
181 sources: [1, 2] | |
182 - rules: | |
183 - type: add_filter_count | |
184 count: 1 | |
185 which: last | |
186 invert: true | |
187 initial: | |
188 data: [[a, b, c], [e, f, g], [h, i, j]] | |
189 sources: [1, 2, 3] | |
190 final: | |
191 data: [[h, i, j]] | |
192 sources: [3] | |
193 - rules: | |
194 - type: add_filter_empty | |
195 target_column: 0 | |
196 invert: false | |
197 initial: | |
198 data: [["", "b", "c"], ["a", "b", "c"]] | |
199 sources: [1, 2] | |
200 final: | |
201 data: [["a", "b", "c"]] | |
202 sources: [2] | |
203 - rules: | |
204 - type: add_filter_empty | |
205 target_column: 0 | |
206 invert: true | |
207 initial: | |
208 data: [["", "b", "c"], ["a", "b", "c"]] | |
209 sources: [moo, cow] | |
210 final: | |
211 data: [["", "b", "c"]] | |
212 sources: [moo] | |
213 | |
214 - rules: | |
215 - type: add_filter_matches | |
216 value: a | |
217 target_column: 0 | |
218 invert: false | |
219 initial: | |
220 data: [[a, b, c], | |
221 [e, f, g], | |
222 [h, i, j]] | |
223 sources: [1, 2, 3] | |
224 final: | |
225 data: [[a, b, c]] | |
226 sources: [1] | |
227 | |
228 - rules: | |
229 - type: add_filter_matches | |
230 value: a | |
231 target_column: 0 | |
232 invert: true | |
233 initial: | |
234 data: [[a, b, c], | |
235 [e, f, g], | |
236 [h, i, j]] | |
237 sources: [1, 2, 3] | |
238 final: | |
239 data: [[e, f, g], | |
240 [h, i, j]] | |
241 sources: [2, 3] | |
242 | |
243 - rules: | |
244 - type: add_filter_matches | |
245 value: p | |
246 target_column: 1 | |
247 invert: false | |
248 initial: | |
249 data: [[a, b, c], | |
250 [e, f, g], | |
251 [h, i, j]] | |
252 sources: [1, 2, 3] | |
253 final: | |
254 data: [] | |
255 sources: [] | |
256 | |
257 - rules: | |
258 - type: add_filter_matches | |
259 value: a | |
260 target_column: 1 | |
261 invert: false | |
262 initial: | |
263 data: [['a ', b, c], | |
264 [e, f, g], | |
265 [h, i, j]] | |
266 sources: [1, 2, 3] | |
267 final: | |
268 data: [] | |
269 sources: [] | |
270 | |
271 - rules: | |
272 - type: add_filter_matches | |
273 value: 'a ' | |
274 target_column: 1 | |
275 invert: false | |
276 initial: | |
277 data: [[a, b, c], | |
278 [e, f, g], | |
279 [h, i, j]] | |
280 sources: [1, 2, 3] | |
281 final: | |
282 data: [] | |
283 sources: [] | |
284 | |
285 - rules: | |
286 - type: add_filter_matches | |
287 value: p | |
288 target_column: 1 | |
289 invert: true | |
290 initial: | |
291 data: [[a, b, c], | |
292 [e, f, g], | |
293 [h, i, j]] | |
294 sources: [1, 2, 3] | |
295 final: | |
296 data: [[a, b, c], | |
297 [e, f, g], | |
298 [h, i, j]] | |
299 sources: [1, 2, 3] | |
300 | |
301 - rules: | |
302 - type: add_filter_compare | |
303 target_column: 0 | |
304 value: 13 | |
305 compare_type: less_than | |
306 initial: | |
307 data: [["1", "moo"], ["10", "cow"], ["13", "rat"], ["20", "dog"], ["30", "cat"]] | |
308 sources: [1, 2, 3, 4, 5] | |
309 final: | |
310 data: [["1", "moo"], ["10", "cow"]] | |
311 sources: [1, 2] | |
312 | |
313 - rules: | |
314 - type: add_filter_compare | |
315 target_column: 0 | |
316 value: 13 | |
317 compare_type: less_than_equal | |
318 initial: | |
319 data: [["1", "moo"], ["10", "cow"], ["13", "rat"], ["20", "dog"], ["30", "cat"]] | |
320 sources: [1, 2, 3, 4, 5] | |
321 final: | |
322 data: [["1", "moo"], ["10", "cow"], ["13", "rat"]] | |
323 sources: [1, 2, 3] | |
324 | |
325 - rules: | |
326 - type: add_filter_compare | |
327 target_column: 0 | |
328 value: 13 | |
329 compare_type: greater_than | |
330 initial: | |
331 data: [["1", "moo"], ["10", "cow"], ["13", "rat"], ["20", "dog"], ["30", "cat"]] | |
332 sources: [1, 2, 3, 4, 5] | |
333 final: | |
334 data: [["20", "dog"], ["30", "cat"]] | |
335 sources: [4, 5] | |
336 | |
337 - rules: | |
338 - type: add_filter_compare | |
339 target_column: 0 | |
340 value: 13 | |
341 compare_type: greater_than_equal | |
342 initial: | |
343 data: [["1", "moo"], ["10", "cow"], ["13", "rat"], ["20", "dog"], ["30", "cat"]] | |
344 sources: [1, 2, 3, 4, 5] | |
345 final: | |
346 data: [["13", "rat"], ["20", "dog"], ["30", "cat"]] | |
347 sources: [3, 4, 5] | |
348 | |
349 - rules: | |
350 - type: sort | |
351 numeric: false | |
352 target_column: 0 | |
353 initial: | |
354 data: [["moo", "cow"], ["meow", "cat"], ["bark", "dog"]] | |
355 sources: [1, 2, 3] | |
356 final: | |
357 data: [["bark", "dog"], ["meow", "cat"], ["moo", "cow"]] | |
358 sources: [3, 2, 1] | |
359 | |
360 - rules: | |
361 - type: sort | |
362 numeric: false | |
363 target_column: 1 | |
364 initial: | |
365 data: [["moo", "cow"], ["meow", "cat"], ["bark", "dog"]] | |
366 sources: [1, 2, 3] | |
367 final: | |
368 data: [["meow", "cat"], ["moo", "cow"], ["bark", "dog"]] | |
369 sources: [2, 1, 3] | |
370 | |
371 - rules: | |
372 - type: sort | |
373 numeric: false | |
374 target_column: 1 | |
375 initial: | |
376 data: [["moo", "cow"], ["meow", "cat"], ["bark", "Dog"]] | |
377 sources: [1, 2, 3] | |
378 final: | |
379 data: [["bark", "Dog"], ["meow", "cat"], ["moo", "cow"]] | |
380 sources: [3, 2, 1] | |
381 | |
382 - rules: | |
383 - type: swap_columns | |
384 target_column_0: 0 | |
385 target_column_1: 1 | |
386 initial: | |
387 data: [["moo", "cow"], ["meow", "cat"], ["bark", "Dog"]] | |
388 sources: [1, 2, 3] | |
389 final: | |
390 data: [["cow", "moo"], ["cat", "meow"], ["Dog", "bark"]] | |
391 sources: [1, 2, 3] | |
392 | |
393 - rules: | |
394 - type: split_columns | |
395 target_columns_0: [0] | |
396 target_columns_1: [1] | |
397 initial: | |
398 data: [["moo", "cow", "A"], ["meow", "cat", "B"], ["bark", "Dog", "C"]] | |
399 sources: [1, 2, 3] | |
400 final: | |
401 data: [["moo", "A"], ["cow", "A"], ["meow", "B"], ["cat", "B"], ["bark", "C"], ["Dog", "C"]] | |
402 sources: [1, 1, 2, 2, 3, 3] | |
403 | |
404 - rules: | |
405 - type: add_column_metadata | |
406 value: identifier0 | |
407 initial: | |
408 data: [["moo"], ["meow"], ["bark"]] | |
409 sources: [{"identifiers": ["cow"]}, {"identifiers": ["cat"]}, {"identifiers": ["dog"]}] | |
410 final: | |
411 data: [["moo", "cow"], ["meow", "cat"], ["bark", "dog"]] | |
412 | |
413 - rules: | |
414 - type: add_column_metadata | |
415 value: tags | |
416 initial: | |
417 data: [["moo"], ["meow"], ["bark"]] | |
418 sources: [{"identifiers": ["cow"], "tags": ["farm"]}, {"identifiers": ["cat"], "tags": ["house"]}, {"identifiers": ["dog"], "tags": ["house", "firestation"]}] | |
419 final: | |
420 data: [["moo", "farm"], ["meow", "house"], ["bark", "firestation,house"]] | |
421 | |
422 - rules: | |
423 - type: add_column_group_tag_value | |
424 value: where | |
425 default_value: '' | |
426 initial: | |
427 data: [["moo"], ["meow"], ["bark"]] | |
428 sources: [{"identifiers": ["cow"], "tags": ["group:where:farm"]}, {"identifiers": ["cat"], "tags": ["group:where:house"]}, {"identifiers": ["dog"], "tags": ["group:where:house"]}] | |
429 final: | |
430 data: [["moo", "farm"], ["meow", "house"], ["bark", "house"]] | |
431 | |
432 - doc: add_column_group_tag_value uses default value | |
433 rules: | |
434 - type: add_column_group_tag_value | |
435 value: where | |
436 default_value: 'barn' | |
437 initial: | |
438 data: [["moo"], ["meow"], ["bark"]] | |
439 sources: [{"identifiers": ["cow"], "tags": []}, {"identifiers": ["cat"], "tags": ["group:where:house"]}, {"identifiers": ["dog"], "tags": ["group:where:firestation"]}] | |
440 final: | |
441 data: [["moo", "barn"], ["meow", "house"], ["bark", "firestation"]] | |
442 | |
443 - doc: add_column_group_tag_value sorts and grabs first tag value if multiple present | |
444 rules: | |
445 - type: add_column_group_tag_value | |
446 value: where | |
447 default_value: 'barn' | |
448 initial: | |
449 data: [["moo"], ["meow"], ["bark"]] | |
450 sources: [{"identifiers": ["cow"], "tags": []}, {"identifiers": ["cat"], "tags": ["group:where:house", "group:where:kittenpile"]}, {"identifiers": ["dog"], "tags": ["group:where:house", "group:where:firestation"]}] | |
451 final: | |
452 data: [["moo", "barn"], ["meow", "house"], ["bark", "firestation"]] | |
453 | |
454 - rules: | |
455 - type: invalid_rule_type | |
456 error: true | |
457 | |
458 - rules: | |
459 - type: add_filter_compare | |
460 target_column: 0 | |
461 value: 13 | |
462 compare_type: invalid_compare_type | |
463 error: true | |
464 | |
465 - rules: | |
466 - type: add_column_concatenate | |
467 target_column: 0 | |
468 error: true | |
469 | |
470 - rules: | |
471 - type: add_column_basename | |
472 target_column_0: 0 | |
473 error: true | |
474 | |
475 - rules: | |
476 - type: add_column_regex | |
477 target_column: 0 | |
478 regex: '(o)+' | |
479 error: true | |
480 | |
481 - rules: | |
482 - type: add_column_regex | |
483 target_column: 0 | |
484 expression: '(o+' | |
485 error: true |