annotate filter_tabular.xml @ 23:5bb148ee644a draft default tip

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