2
|
1 <tool id="generic_filter" name="Generic_Filter" version="2017.06">
|
0
|
2 <description>Removes elements according to numerical or qualitative values</description>
|
2
|
3 <requirements>
|
|
4 <requirement type="package" version="1.1_4">r-batch</requirement>
|
|
5 </requirements>
|
|
6 <command>
|
|
7 Rscript '$__tool_directory__/filter_wrap.R'
|
0
|
8 dataMatrix_in "$dataMatrix_in"
|
|
9 sampleMetadata_in "$sampleMetadata_in"
|
|
10 variableMetadata_in "$variableMetadata_in"
|
|
11
|
|
12 Numeric "${numeric_condition.Factors}"
|
|
13 #if str($numeric_condition.Factors) == 'TRUE':
|
|
14 #for $i in $numeric_condition.numeric_repeat:
|
|
15 num_file "${i.num_file}"
|
|
16 parm_col "${i.parm_col_num}"
|
|
17 Interval "${i.interval_condition.interval}"
|
|
18 #if str($i.interval_condition.interval) == 'lower':
|
|
19 low_value "${i.interval_condition.low_value}"
|
|
20 #elif str($i.interval_condition.interval) == 'upper':
|
|
21 up_value "${i.interval_condition.up_value}"
|
|
22 #elif str($i.interval_condition.interval) == 'between':
|
|
23 low_value "${i.interval_condition.low_value}"
|
|
24 up_value "${i.interval_condition.up_value}"
|
|
25 #elif str($i.interval_condition.interval) == 'extremity':
|
|
26 low_value "${i.interval_condition.low_value}"
|
|
27 up_value "${i.interval_condition.up_value}"
|
|
28 #end if
|
|
29 #end for
|
|
30 #end if
|
|
31
|
|
32 Factors "${qualitative_condition.Factors}"
|
|
33 #if str($qualitative_condition.Factors) == 'TRUE':
|
|
34 #for $i in $qualitative_condition.qualitative_repeat:
|
|
35 qual_file "${i.qual_file}"
|
|
36 factor_col "${i.factor_col}"
|
|
37 factors_value "${i.factors_value}"
|
|
38 #end for
|
|
39 #end if
|
|
40
|
|
41 dataMatrix_out "$dataMatrix_out"
|
|
42 sampleMetadata_out "$sampleMetadata_out"
|
|
43 variableMetadata_out "$variableMetadata_out"
|
|
44 </command>
|
|
45
|
|
46 <inputs>
|
|
47 <param name="dataMatrix_in" type="data" label="Data Matrix file" help="" format="tabular" />
|
|
48 <param name="sampleMetadata_in" type="data" label="Sample metadata file" help="" format="tabular" />
|
|
49 <param name="variableMetadata_in" type="data" label="Variable metadata file" help="" format="tabular" />
|
|
50
|
|
51 <conditional name="numeric_condition">
|
|
52 <param name="Factors" type="select" label="Deleting samples and/or variables according to Numerical values" help="">
|
|
53 <option value="FALSE">no</option>
|
|
54 <option value="TRUE">yes</option>
|
|
55 </param>
|
|
56 <when value="TRUE">
|
|
57 <repeat name="numeric_repeat" title="Identify the parameter to filter " min="1">
|
|
58 <param name="num_file" label="On file" type="select" display="radio" help="">
|
|
59 <option value="sample">Sample metadata</option>
|
|
60 <option value="variable">Variable metadata</option>
|
|
61 </param>
|
|
62 <param name="parm_col_num" label="Name of the column to filter" type="text" value="" help="" />
|
|
63 <conditional name="interval_condition">
|
|
64 <param name="interval" type="select" label="Interval of values to remove" help="">
|
|
65 <option value="lower">lower</option>
|
|
66 <option value="upper">upper</option>
|
|
67 <option value="between">between</option>
|
|
68 <option value="extremity">extremity</option>
|
|
69 </param>
|
|
70 <when value="lower">
|
|
71 <param name="low_value" type="float" label="Remove all values lower than" optional="true" value="0" help=""/>
|
|
72 </when>
|
|
73 <when value="upper">
|
|
74 <param name="up_value" type="float" label="Remove all values upper than" optional="true" value="0" help=""/>
|
|
75 </when>
|
|
76 <when value="between">
|
|
77 <param name="low_value" type="float" label="Remove all values between" optional="true" value="0" help=""/>
|
|
78 <param name="up_value" type="float" label="And" optional="true" value="1" help=""/>
|
|
79 </when>
|
|
80 <when value="extremity">
|
|
81 <param name="low_value" type="float" label="Remove all values lower than" optional="true" value="0" help=""/>
|
|
82 <param name="up_value" type="float" label="And upper than" optional="true" value="1" help=""/>
|
|
83 </when>
|
|
84 </conditional>
|
|
85 </repeat>
|
|
86 </when>
|
|
87 <when value="FALSE">
|
|
88 </when>
|
|
89 </conditional>
|
|
90
|
|
91 <conditional name="qualitative_condition">
|
|
92 <param name="Factors" type="select" label="Deleting samples and/or variables according to Qualitative values" help="">
|
|
93 <option value="FALSE">no</option>
|
|
94 <option value="TRUE">yes</option>
|
|
95 </param>
|
|
96 <when value="TRUE">
|
|
97 <repeat name="qualitative_repeat" title="Removing a level in factor" min="1">
|
|
98 <param name="qual_file" label="On file" type="select" display="radio" help="">
|
|
99 <option value="sample">Sample metadata</option>
|
|
100 <option value="variable">Variable metadata</option>
|
|
101 </param>
|
|
102 <param name="factor_col" label="Name of the column to filter" type="text" value="" help="" />
|
|
103 <param name="factors_value" type="text" label="Remove factor when" help="" value="" />
|
|
104 </repeat>
|
|
105 </when>
|
|
106 <when value="FALSE">
|
|
107 </when>
|
|
108 </conditional>
|
|
109 </inputs>
|
|
110
|
|
111 <outputs>
|
|
112 <data name="dataMatrix_out" label="${tool.name}_${dataMatrix_in.name}" format="tabular" ></data>
|
|
113 <data name="sampleMetadata_out" label="${tool.name}_${sampleMetadata_in.name}" format="tabular" ></data>
|
|
114 <data name="variableMetadata_out" label="${tool.name}_${variableMetadata_in.name}" format="tabular" ></data>
|
|
115 </outputs>
|
|
116
|
2
|
117 <tests>
|
|
118 <test>
|
|
119 <param name="dataMatrix_in" value="in_DM1.tabular"/>
|
|
120 <param name="sampleMetadata_in" value="in_SM1.tabular"/>
|
|
121 <param name="variableMetadata_in" value="in_VM1.tabular"/>
|
|
122 <conditional name="numeric_condition">
|
|
123 <param name="Factors" value="TRUE"/>
|
|
124 <param name="numeric_repeat_0|num_file" value="variable"/>
|
|
125 <param name="numeric_repeat_0|parm_col_num" value="rt"/>
|
|
126 <param name="numeric_repeat_0|interval_condition|interval" value="lower"/>
|
|
127 <param name="numeric_repeat_0|interval_condition|low_value" value="1.2"/>
|
|
128 </conditional>
|
|
129 <conditional name="qualitative_condition">
|
|
130 <param name="Factors" value="TRUE"/>
|
|
131 <param name="qualitative_repeat_0|qual_file" value="sample"/>
|
|
132 <param name="qualitative_repeat_0|factor_col" value="Time"/>
|
|
133 <param name="qualitative_repeat_0|factors_value" value="3"/>
|
|
134 </conditional>
|
|
135 <output name="dataMatrix_out" file="out_DM1.tabular"/>
|
|
136 <output name="sampleMetadata_out" file="out_SM1.tabular"/>
|
|
137 <output name="variableMetadata_out" file="out_VM1.tabular"/>
|
|
138 </test>
|
|
139 </tests>
|
|
140
|
0
|
141 <help>
|
|
142
|
|
143 .. class:: infomark
|
|
144
|
|
145 **Authors** Marion Landi and Melanie Petera
|
|
146
|
|
147 ---------------------------------------------------
|
|
148
|
|
149 ==============
|
|
150 Generic_Filter
|
|
151 ==============
|
|
152
|
|
153 -----------
|
|
154 Description
|
|
155 -----------
|
|
156
|
|
157 | Allows to remove all samples and/or variables corresponding to specific values regarding designated factors or numerical variables.
|
|
158 |
|
|
159
|
|
160
|
|
161 -----------------
|
|
162 Workflow position
|
|
163 -----------------
|
|
164
|
|
165
|
|
166 .. image:: filter.png
|
|
167 :width: 800
|
|
168
|
|
169
|
|
170
|
|
171 -----------
|
|
172 Input files
|
|
173 -----------
|
|
174
|
|
175 +----------------------------+------------+
|
|
176 | Parameter : num + label | Format |
|
|
177 +============================+============+
|
|
178 | 1 : Data Matrix file | tabular |
|
|
179 +----------------------------+------------+
|
|
180 | 2 : Sample metadata file | tabular |
|
|
181 +----------------------------+------------+
|
|
182 | 3 : Variable metadata file | tabular |
|
|
183 +----------------------------+------------+
|
|
184
|
|
185 |
|
|
186 | Missing values in numerical columns of data must be coded NA if you want to use the Numerical filter on them.
|
|
187
|
|
188
|
|
189 ----------
|
|
190 Parameters
|
|
191 ----------
|
|
192
|
|
193 Deleting samples and/or variables according to Numerical values:
|
|
194 | If 'yes' (not default): execution deletes all samples or variables (according to selection) for which the designated
|
|
195 | numerical parameter ("Name of the column to remove" field) equals the selected range of values (depending on the "Interval of values to remove" chosen).
|
|
196 | To delete multiple independent intervals of value from the same parameter, it is necessary to add as many times as necessary
|
|
197 | the corresponding column via the button "Add new Identify the parameter to filter".
|
|
198
|
|
199 | *On file (only if 'yes')*
|
|
200 | Choice between sample and variable filtering (referring to the input file containing the factor).
|
|
201 |
|
|
202
|
|
203 | *Name of the column to filter (only if 'yes')*
|
|
204 | Column name of the numerical parameter from which we want to remove a range of values.
|
|
205 |
|
|
206
|
|
207 | *Interval of values to remove (only if 'yes')*
|
|
208 | Allows to choose which type of interval should be removed:
|
|
209 | - lower: removes all values below a specified value
|
|
210 | - upper: removes all values above a specified value
|
|
211 | - between: removes all values both greater than a specified value and lower than another (upper) one
|
|
212 | - extremity: removes all values that are either lower than a specified value or greater than another (upper) one
|
|
213 |
|
|
214
|
|
215 | *'Remove all values' + interval chosen (only if 'yes')*
|
|
216 | Numerical value(s) used as threshold, depending on the type of interval chosen above.
|
|
217 | Only one value for 'lower' and 'upper'; two values for 'between' and 'extremity'.
|
|
218 |
|
|
219
|
|
220 | *Notes:*
|
|
221 | - these parameters can be used several times using the "Add new Identify the parameter to filter" button
|
|
222 | - Numerical filter does not remove NA values; if you want to suppress them, use the Qualitative filter below
|
|
223 |
|
|
224
|
|
225
|
|
226 Deleting samples and/or variables according to Qualitative values
|
|
227 | If 'yes' (not default): execution deletes all data samples or variables (according to selection) for which the designated
|
|
228 | factor ("Name of the column to remove" field) equals the selected level ("Remove factor when" field).
|
|
229 | To delete multiple values of the same factor, it is necessary to add as many times as necessary the corresponding factor
|
|
230 | via the button "Add new Removing a level in factor".
|
|
231
|
|
232 | *On file (only if 'yes')*
|
|
233 | Choice between sample and variable filtering (referring to the input file containing the factor).
|
|
234 |
|
|
235
|
|
236 | *Name of the column to filter (only if 'yes')*
|
|
237 | Column name of the factor from which we want to remove a level.
|
|
238 |
|
|
239
|
|
240 | *Remove factor when (only if 'yes')*
|
|
241 | Value that you want to delete from the selected column.
|
|
242 | Each line with that value of designated factor will be deleted.
|
|
243 |
|
|
244
|
|
245 | *Notes:*
|
|
246 | - these parameters can be used several times using the "Add new Removing a level in factor" button
|
|
247 | - this filter can be used to filter NA in numerical parameters, or to remove a specific numerical value
|
|
248 |
|
|
249
|
|
250
|
|
251 ------------
|
|
252 Output files
|
|
253 ------------
|
|
254
|
|
255
|
|
256 dataMatrix
|
|
257 | tabular output
|
|
258 | Identical to the input Data Matrix file with the sample columns and variable lines deleted according to specified filters
|
|
259 |
|
|
260
|
|
261 sampleMetadata
|
|
262 | tabular output
|
|
263 | Identical to the input Sample metadata file with the sample lines deleted according to specified filters
|
|
264 |
|
|
265
|
|
266 variableMetadata
|
|
267 | tabular output
|
|
268 | Identical to the input Variable metadata file with the variable lines deleted according to specified filters
|
|
269 |
|
|
270
|
|
271
|
|
272 ---------------------------------------------------
|
|
273
|
|
274 ---------------
|
|
275 Working example
|
|
276 ---------------
|
|
277
|
|
278
|
|
279 .. class:: warningmark
|
|
280
|
|
281 Soon see the corresponding "Page"
|
|
282
|
|
283 </help>
|
2
|
284 <citations>
|
|
285 <citation type="doi">10.1093/bioinformatics/btu813</citation>
|
|
286 </citations>
|
0
|
287 </tool> |