annotate filter_tabular.xml @ 20:ab27c4bd14b9 draft

Uploaded
author jjohnson
date Fri, 14 Jul 2017 11:39:27 -0400
parents
children 357fe86f245d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
1 <tool id="filter_tabular" name="Filter Tabular" version="5.0.0">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
2 <description></description>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
3
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
4 <macros>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
5 <import>macros.xml</import>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
6 </macros>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
7
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
8 <requirements>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
9 </requirements>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
10 <stdio>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
11 <exit_code range="1:" />
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
12 </stdio>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
13 <command><![CDATA[
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
14 python $__tool_directory__/filter_tabular.py
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
15 -i '$input'
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
16 -j '$filter_json'
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
17 -o '$output'
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
18 ]]></command>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
19 <configfiles>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
20 <configfile name="filter_json">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
21 #import json
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
22 @LINEFILTERS@
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
23 #if $input_filters:
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
24 #echo $json.dumps($input_filters)
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
25 #end if
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
26 </configfile>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
27 </configfiles>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
28 <inputs>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
29 <param name="input" type="data" format="tabular" label="Tabular Dataset to filter"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
30 <expand macro="macro_line_filters" />
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
31 </inputs>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
32 <outputs>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
33 <data format="tabular" name="output" />
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
34 </outputs>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
35 <tests>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
36 <test>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
37 <param name="input" ftype="tabular" value="pets.tsv"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
38 <repeat name="linefilters">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
39 <param name="filter_type" value="comment"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
40 <param name="comment_char" value="35"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
41 </repeat>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
42 <repeat name="linefilters">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
43 <param name="filter_type" value="append_line_num"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
44 </repeat>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
45 <repeat name="linefilters">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
46 <param name="filter_type" value="select_columns"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
47 <param name="columns" value="7,2,3,4,1"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
48 </repeat>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
49 <repeat name="linefilters">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
50 <param name="filter_type" value="replace"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
51 <param name="column" value="c4"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
52 <param name="regex_pattern" value="(\d+)/(\d+)/(\d+)"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
53 <param name="regex_replace" value="19\3-\2-\1"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
54 </repeat>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
55 <output name="output" file="filtered_people_results.tsv"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
56 </test>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
57 <test>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
58 <param name="input" ftype="tabular" value="pets.tsv"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
59 <repeat name="linefilters">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
60 <param name="filter_type" value="comment"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
61 <param name="comment_char" value="35"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
62 </repeat>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
63 <repeat name="linefilters">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
64 <param name="filter_type" value="append_line_num"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
65 </repeat>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
66 <repeat name="linefilters">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
67 <param name="filter_type" value="select_columns"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
68 <param name="columns" value="c7,c5,c6"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
69 </repeat>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
70 <repeat name="linefilters">
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
71 <param name="filter_type" value="normalize"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
72 <param name="columns" value="c2,c3"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
73 <param name="separator" value=","/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
74 </repeat>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
75 <output name="output" file="filtered_pets_results.tsv"/>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
76 </test>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
77
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
78 </tests>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
79 <help><![CDATA[
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
80 ==============
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
81 Filter Tabular
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
82 ==============
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
83
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
84 Filter a tabular dataset by applying line filters as it is being read.
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
85 Multiple filters may be used with each filter using the result of the previous filter.
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
86
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
87 **Inputs**
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
88
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
89 A tabular dataset.
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
90
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
91
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
92 **Outputs**
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
93
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
94 A filtered tabular dataset.
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
95
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
96
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
97 @LINEFILTERS_HELP@
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
98
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
99 @LINEFILTERS_HELP_EXAMPLE@
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
100
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
101 ]]></help>
ab27c4bd14b9 Uploaded
jjohnson
parents:
diff changeset
102 </tool>