comparison filter.xml @ 0:58ed60d20336 draft default tip

"planemo upload for repository https://github.com/shenwei356/csvtk commit 3a97e1b79bf0c6cdd37d5c8fb497b85531a563ab"
author nml
date Tue, 19 May 2020 17:23:16 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:58ed60d20336
1 <tool id="csvtk_filter" name="csvtk-filter" version="@VERSION@+@GALAXY_VERSION@">
2 <description> rows through arithmetic expression(s)</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="requirements" />
7 <expand macro="version_cmd" />
8 <command detect_errors="exit_code"><![CDATA[
9
10 ###################
11 ## Start Command ##
12 ###################
13 csvtk filter --num-cpus "\${GALAXY_SLOTS:-1}"
14
15 ## Add additional flags as specified ##
16 #######################################
17 $global_param.illegal_rows
18 $global_param.empty_rows
19 $global_param.header
20 $global_param.lazy_quotes
21
22 ## Set Tabular input/output flag if first input is tabular ##
23 #############################################################
24 #if $in_1.is_of_type("tabular"):
25 -t -T
26 #end if
27
28 ## Set input files ##
29 #####################
30 $in_1
31
32 ## Specify fields to filter ##
33 ##############################
34 -F -f '$in_text'
35
36 ## Specific inputs ##
37 #####################
38 $any
39 $line_number
40
41 ## To output ##
42 ###############
43 > filtered
44
45 ]]></command>
46 <inputs>
47 <expand macro="singular_input"/>
48 <param name="in_text" type="text"
49 optional="false"
50 argument="-F -f"
51 label="Specify column(s) and numeric expression to filter for"
52 help="Give column name/number and the numeric expression that you want to evaluate. Example: 'frequency>4'. See help below for more examples">
53 <expand macro="text_sanitizer" />
54 </param>
55 <param name="line_number" type="boolean"
56 checked="false"
57 truevalue="-n"
58 falsevalue=""
59 argument="-n"
60 label="Print initial line number as the first column"
61 />
62 <param name="any" type="boolean"
63 checked="false"
64 truevalue="--any"
65 falsevalue=""
66 argument="--any"
67 label="Return row if any row value satisfies the condition"
68 help="For multiple column filters only"
69 />
70 <expand macro="global_parameters" />
71 </inputs>
72 <outputs>
73 <data format_source="in_1" from_work_dir="filtered" name="filtered" label="${in_1.name} filtered with ${in_text}" />
74 </outputs>
75 <tests>
76 <test>
77 <param name="in_1" value="frequency.tsv" />
78 <param name="in_text" value="frequency>1" />
79 <output name="filtered" file="filtered.tsv" ftype="tabular" />
80 </test>
81 </tests>
82 <help><![CDATA[
83
84 Csvtk - Filter Help
85 -------------------
86
87 Info
88 ####
89
90 Csvtk filter outputs rows that satisfy an input numerical expression on the specified column(s).
91
92 .. class:: warningmark
93
94 Single quotes are not allowed in text inputs!
95
96 @HELP_INPUT_DATA@
97
98
99 Usage
100 #####
101
102 **Ex. Filter on one column:**
103
104 Suppose we had the following table:
105
106 +---------------+------------+----------+
107 | Culture Label | Cell Count | Dilution |
108 +===============+============+==========+
109 | ECo-1 | 2523 | 1000 |
110 +---------------+------------+----------+
111 | LPn-1 | 100 | 1000000 |
112 +---------------+------------+----------+
113 | LPn-2 | 4 | 1000 |
114 +---------------+------------+----------+
115
116 If we used the filter expression "Cell Count>100", we would get the following output column:
117
118 +---------------+------------+----------+
119 | Culture Label | Cell Count | Dilution |
120 +===============+============+==========+
121 | ECo-1 | 2523 | 1000 |
122 +---------------+------------+----------+
123
124 ----
125
126 **Ex2. Filter on two columns:**
127
128 Same input table
129
130 +---------------+------------+----------+
131 | Culture Label | Cell Count | Dilution |
132 +===============+============+==========+
133 | ECo-1 | 2523 | 1000 |
134 +---------------+------------+----------+
135 | LPn-1 | 100 | 1000000 |
136 +---------------+------------+----------+
137 | LPn-2 | 4 | 1000 |
138 +---------------+------------+----------+
139
140 Now if we use the expression "2-3>50" to filter on, we would pull out:
141
142 +---------------+------------+----------+
143 | Culture Label | Cell Count | Dilution |
144 +===============+============+==========+
145 | ECo-1 | 2523 | 1000 |
146 +---------------+------------+----------+
147 | LPn-1 | 100 | 1000000 |
148 +---------------+------------+----------+
149
150 Row 3 is not returned back as its column 2 is not greater than 50.
151
152 However, if **Any** is set to Yes, then Row 3 would be returned as its column 3 is greater than 50
153 making it satisfy one part of the expression.
154
155
156 **Note:** - Multiple columns can only be specified with a "-"
157
158 ----
159
160 @HELP_COLUMNS@
161
162
163 @HELP_END_STATEMENT@
164
165
166 ]]></help>
167 <expand macro="citations" />
168 </tool>