comparison metaquantome_viz.xml @ 0:6cfd42b015b4 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/metaquantome commit d45eb2747cc58e1120b3935f10ab47c4e0f8f44a
author galaxyp
date Thu, 25 Apr 2019 13:48:59 -0400
parents
children 8c30496a665a
comparison
equal deleted inserted replaced
-1:000000000000 0:6cfd42b015b4
1 <tool id="metaquantome_viz" name="metaQuantome: visualize" version="@GVERSION@">
2 <description>taxonomic analysis, functional analysis, and function-taxonomy analysis results</description>
3 <macros>
4 <import>macros.xml</import>
5 <xml name="barcol">
6 <param argument="--barcol" type="select" label="Color for the bar fill">
7 <option value="1">Blue</option>
8 <option value="2">Orange</option>
9 <option value="3">Yellow</option>
10 <option value="4">Red</option>
11 <option value="5">Violet</option>
12 <option value="6">Black</option>
13 <help>
14 These same colors are also used in the heatmap and PCA plot,
15 so the colors can be tweaked to match. Note that these colors
16 are coded as 1 through 6 in the command line tool.
17 </help>
18 </param>
19 </xml>
20 <xml name="common_bar_params">
21 <param argument="--meancol" type="text" label="Mean intensity column name"
22 help="Mean intensity column name for desired experimental condition">
23 <validator type="empty_field"/>
24 </param>
25 <param argument="--nterms" type="integer"
26 value="5" min="1" optional="true"
27 label="Number of terms to display"
28 help="leave blank for all terms"/>
29 </xml>
30 <xml name="common_volc_params">
31 <param argument="--fc_name" type="text" label="Name of the fold change column in the stat dataframe">
32 <validator type="empty_field"/>
33 </param>
34 <param argument="--textannot" type="text" optional="true" label="Name of the annotation column"
35 help="Provides text annotatation for the plot. Optional. If missing, no text will be plotted."/>
36 <param argument="--flip_fc" type="boolean" truevalue="--flip_fc" falsevalue="" checked="false"
37 label="Flip the fold change (i.e., multiply log fold change by -1)"/>
38 </xml>
39 <xml name="common_heatmap_params">
40 <conditional name="heatmap">
41 <param argument="--filter_to_sig" type="boolean" checked="false"
42 label="Only plot significant term" help="Necessitates use of results from `test`"/>
43 <when value="true">
44 <param argument="--alpha" type="float"
45 value="0.05" min="0.0" max="1.0"
46 label="The q-value significance level"/>
47 </when>
48 <when value="false">
49 <!-- do nothing -->
50 </when>
51 </conditional>
52 </xml>
53 <xml name="pca_calcsep">
54 <param argument="--calculate_sep" type="boolean" truevalue="--calculate_sep" falsevalue="" checked="false"
55 label="Calculate separation between groups and include in title?"/>
56 </xml>
57 <xml name="target_onto">
58 <param argument="--target_onto" type="select" optional="false"
59 label="GO category to restrict to">
60 <help>
61 Only the values from this category
62 of GO terms will be displayed.
63 </help>
64 <option value="bp">Biological Process</option>
65 <option value="mf">Molecular Function</option>
66 <option value="cc">Cellular Component</option>
67 </param>
68 </xml>
69 </macros>
70 <expand macro="requirements" />
71 <command detect_errors="exit_code"><![CDATA[
72 metaquantome viz
73 --samps '$samps'
74 --mode '$mode_args.mode'
75 #if str($mode_args.mode) == 'f'
76 --ontology='$mode_args.ontology'
77 #end if
78 --infile='$infile'
79 --plottype='$mode_args.plot.plottype'
80 #if $mode_args.plot.plottype == 'bar':
81 #if str($mode_args.mode) == 't':
82 --target_rank='$mode_args.plot.target_rank'
83 #end if
84 --meancol='$mode_args.plot.meancol'
85 #if str($mode_args.plot.nterms) == '':
86 --nterms='all'
87 #else
88 --nterms=$mode_args.plot.nterms
89 #end if
90 #if str($mode_args.mode) == 'f':
91 --target_onto='$mode_args.plot.target_onto'
92 #end if
93 --barcol=$mode_args.plot.barcol
94 #elif $mode_args.plot.plottype == 'volcano':
95 --fc_name='$mode_args.plot.fc_name'
96 #if $mode_args.plot.textannot:
97 --textannot='$mode_args.plot.textannot'
98 #end if
99 $mode_args.plot.flip_fc
100 #if $mode_args.mode == 'f':
101 $mode_args.plot.gosplit
102 #end if
103 #elif $mode_args.plot.plottype == 'heatmap':
104 #if $mode_args.plot.heatmap.filter_to_sig:
105 --filter_to_sig
106 --alpha=$mode_args.plot.heatmap.alpha
107 #end if
108 #elif $mode_args.plot.plottype == 'pca':
109 $mode_args.plot.calculate_sep
110 #elif $mode_args.plot.plottype == 'ft_dist':
111 --barcol='$mode_args.plot.barcol'
112 --whichway='$mode_args.plot.margin.whichway'
113 --meancol='$mode_args.plot.meancol'
114 #if $mode_args.plot.margin.term.id_or_name == 'id':
115 --id='$mode_args.plot.margin.term.id'
116 #else:
117 --name='$mode_args.plot.margin.term.name'
118 #end if
119 #if $mode_args.plot.margin.whichway == 't_dist':
120 --target_rank='$mode_args.plot.margin.target_rank'
121 #end if
122 #if $mode_args.plot.margin.whichway == 'f_dist':
123 --target_onto=$mode_args.plot.margin.target_onto
124 #end if
125 #end if
126 #if $width:
127 --width=$width
128 #end if
129 #if $height:
130 --height=$height
131 #end if
132 --img='outfile.png'
133 --tabfile='plotdata.tab' &&
134 mkdir '${ wrapped_outfile.files_path }' &&
135 cp outfile.png '${ wrapped_outfile.files_path }' &&
136 echo "<!DOCTYPE html>
137 <html>
138 <body>
139 <img src=\"outfile.png\" width=600>
140 <br>
141 <p>To download the image, right-click and choose \"Save image as...\"</p>
142 <br>
143 <p>
144 If text is cut off or the plot is not displaying properly,
145 the easiest fix is to increase the plot dimensions
146 </p>
147 </body>
148 </html>" > wrapped_outfile.html
149 ]]></command>
150 <inputs>
151 <param argument="--infile" type="data"
152 format="tabular" label="Tabular file from metaQuantome stats or metaQuantome filter" help=""/>
153 <expand macro="SAMPS"/>
154 <conditional name="mode_args">
155 <param argument="--mode" type="select" label="Mode">
156 <option value="f">Functional analysis</option>
157 <option value="t">Taxonomic analysis</option>
158 <option value="ft">Functional-taxonomic interaction analysis</option>
159 </param>
160 <when value="f">
161 <param name="ontology" type="select" label="Ontology">
162 <option value="go">Gene Ontology (GO terms)</option>
163 <option value="ec">Enzyme Commission (EC) numbers</option>
164 <option value="cog">Clusters of Orthologous Groups (COG categories)</option>
165 </param>
166 <conditional name="plot">
167 <param argument="--plottype" type="select" label="Plot type">
168 <option value="bar">Bar Chart (bar)</option>
169 <option value="volcano">Volcano Plot (volcano)</option>
170 <option value="heatmap">Heatmap (heatmap)</option>
171 <option value="pca">Principal Components Analysis (pca)</option>
172 </param>
173 <when value="bar">
174 <expand macro="common_bar_params"/>
175 <expand macro="target_onto"/>
176 <expand macro="barcol"/>
177 </when>
178 <when value="volcano">
179 <expand macro="common_volc_params"/>
180 <param argument="--gosplit" type="boolean" truevalue="--gosplit" falsevalue="" checked="false"
181 label="Make one plot for each of BiologicalProcess, CellularComponent, and MolecularFunction GO term categories."/>
182 </when>
183 <when value="heatmap">
184 <expand macro="common_heatmap_params"/>
185 </when>
186 <when value="pca">
187 <expand macro="pca_calcsep"/>
188 </when>
189 </conditional>
190 </when>
191 <when value="t">
192 <conditional name="plot">
193 <param argument="--plottype" type="select" label="Plot type">
194 <option value="bar">Bar Chart (bar)</option>
195 <option value="volcano">Volcano Plot (volcano)</option>
196 <option value="heatmap">Heatmap (heatmap)</option>
197 <option value="pca">Principal Components Analysis (pca)</option>
198 </param>
199 <when value="bar">
200 <param argument="--target_rank" type="select"
201 label="Taxonomic rank to restrict to in the plot"
202 help="possibilities are taken from the input dataset.">
203 <options from_dataset="infile">
204 <column name="value" index="2"/>
205 <filter type="unique_value" name="unique_taxon" column="2"/>
206 <!-- <filter type="remove_value" value="rank" column="2"/> -->
207 </options>
208 </param>
209 <expand macro="common_bar_params"/>
210 <expand macro="barcol"/>
211 </when>
212 <when value="volcano">
213 <expand macro="common_volc_params"/>
214 </when>
215 <when value="heatmap">
216 <expand macro="common_heatmap_params"/>
217 </when>
218 <when value="pca">
219 <expand macro="pca_calcsep"/>
220 </when>
221 </conditional>
222 </when>
223 <when value="ft">
224 <conditional name="plot">
225 <param argument="--plottype" type="select" label="Plot type">
226 <option value="ft_dist" selected="true">Functional Taxonomic Distribution (ft_dist)</option>
227 </param>
228 <when value="ft_dist">
229 <param argument="--meancol" type="text" label="Mean intensity column name"
230 help="Mean intensity column name for desired experimental condition">
231 <validator type="empty_field"/>
232 </param>
233 <conditional name="margin">
234 <param argument="--whichway" type="select" label="which distribution">
235 <option value="f_dist">functional distribution for a taxon (f_dist)</option>
236 <option value="t_dist">taxonomic distribution for a function (t_dist)</option>
237 </param>
238 <when value="f_dist">
239 <conditional name="term">
240 <param name="id_or_name" type="select" label="">
241 <option value="id" selected="true">Taxon ID</option>
242 <option value="name">Taxon name</option>
243 </param>
244 <when value="id">
245 <param argument="--id" type="select" label="Taxon id">
246 <options from_dataset="infile">
247 <column name="value" index="3"/>
248 <filter type="unique_value" column="3"/>
249 <!-- <filter type="remove_value" value="tax_id"/> -->
250 </options>
251 </param>
252 </when>
253 <when value="name">
254 <param argument="--name" type="select" label="Taxon name">
255 <options from_dataset="infile">
256 <column name="value" index="4"/>
257 <filter type="unique_value" column="4"/>
258 <!-- <filter type="remove_value" value="taxon_name"/> -->
259 </options>
260 </param>
261 </when>
262 </conditional>
263 <expand macro="target_onto"/>
264 </when>
265 <when value="t_dist">
266 <conditional name="term">
267 <param name="id_or_name" type="select" label="">
268 <option value="id" selected="true">Functional term ID</option>
269 <option value="name">Functional term name</option>
270 </param>
271 <when value="id">
272 <param argument="--id" type="select" label="Functional term id">
273 <options from_dataset="infile">
274 <column name="value" index="0"/>
275 <filter type="unique_value" column="0"/>
276 <!-- <filter type="remove_value" value="go_id"/> -->
277 </options>
278 </param>
279 </when>
280 <when value="name">
281 <param argument="--name" type="select" label="Functional term name">
282 <options from_dataset="infile">
283 <column name="value" index="1"/>
284 <filter type="unique_value" column="1"/>
285 <!-- <filter type="remove_value" value="name"/> -->
286 </options>
287 </param>
288 </when>
289 </conditional>
290 <param argument="--target_rank" type="select"
291 label="Taxonomic rank to restrict to in the plot"
292 help="possibilities are taken from the input dataset.">
293 <options from_dataset="infile">
294 <column name="value" index="5"/>
295 <filter type="unique_value" name="unique_taxon" column="5"/>
296 <!-- <filter type="remove_value" value="rank" column="5"/> -->
297 </options>
298 </param>
299 </when>
300 </conditional>
301 <expand macro="barcol"/>
302 </when>
303 </conditional>
304 </when>
305 </conditional>
306 <param argument="--width" type="float" value="" optional="true" label="Image width in inches"/>
307 <param argument="--height" type="float" value="" optional="true" label="Image height in inches"/>
308 </inputs>
309 <outputs>
310 <data format="html" name="wrapped_outfile"
311 label="${tool.name} on ${on_string} ${mode_args.plot.plottype}.html"
312 from_work_dir="wrapped_outfile.html"/>
313 <data format="tabular" name="plotdata"
314 label="${tool.name} ${on_string} ${mode_args.plot.plottype}: plot data"
315 from_work_dir="plotdata.tab">
316 <filter>mode_args['plot']['plottype'] in ["bar", "volcano"]</filter>
317 </data>
318 </outputs>
319 <tests>
320 <test>
321 <param name="infile" value="tax_filt_out.tab" ftype="tabular"/>
322 <param name="mode" value="t" />
323 <param name="samps" value="rudney_samples.tab" ftype="tabular"/>
324 <param name="plottype" value="bar" />
325 <param name="target_rank" value="genus" />
326 <param name="meancol" value="NS_mean" />
327 <output name="wrapped_outfile">
328 <assert_contents>
329 <has_text text="To download the image" />
330 </assert_contents>
331 </output>
332 </test>
333 <test>
334 <param name="infile" value="tax_test_out.tab" ftype="tabular"/>
335 <param name="mode" value="t" />
336 <param name="samps" value="rudney_samples.tab" ftype="tabular"/>
337 <param name="plottype" value="volcano" />
338 <param name="target_rank" value="genus" />
339 <param name="fc_name" value="log2fc_NS_over_WS" />
340 <param name="textannot" value="taxon_name" />
341 <output name="wrapped_outfile">
342 <assert_contents>
343 <has_text text="To download the image" />
344 </assert_contents>
345 </output>
346 </test>
347 <test>
348 <param name="infile" value="tax_test_out.tab" ftype="tabular"/>
349 <param name="mode" value="t" />
350 <param name="samps" value="rudney_samples.tab" ftype="tabular"/>
351 <param name="plottype" value="heatmap" />
352 <output name="wrapped_outfile">
353 <assert_contents>
354 <has_text text="To download the image" />
355 </assert_contents>
356 </output>
357 </test>
358 <test>
359 <param name="infile" value="tax_test_out.tab" ftype="tabular"/>
360 <param name="mode" value="t" />
361 <param name="samps" value="rudney_samples.tab" ftype="tabular"/>
362 <param name="plottype" value="pca" />
363 <output name="wrapped_outfile">
364 <assert_contents>
365 <has_text text="To download the image" />
366 </assert_contents>
367 </output>
368 </test>
369 <test>
370 <param name="infile" value="func_full_test_out.tab" ftype="tabular"/>
371 <param name="mode" value="f" />
372 <param name="ontology" value="go" />
373 <param name="samps" value="rudney_samples.tab" ftype="tabular"/>
374 <param name="plottype" value="bar" />
375 <param name="meancol" value="NS_mean" />
376 <param name="target_onto" value="bp"/>
377 <output name="wrapped_outfile">
378 <assert_contents>
379 <has_text text="To download the image" />
380 </assert_contents>
381 </output>
382 </test>
383 <test>
384 <param name="infile" value="func_full_test_out.tab" ftype="tabular"/>
385 <param name="mode" value="f" />
386 <param name="ontology" value="go"/>
387 <param name="samps" value="rudney_samples.tab" ftype="tabular"/>
388 <param name="plottype" value="volcano" />
389 <param name="fc_name" value="log2fc_NS_over_WS" />
390 <output name="wrapped_outfile">
391 <assert_contents>
392 <has_text text="To download the image" />
393 </assert_contents>
394 </output>
395 </test>
396 <test>
397 <param name="infile" value="tf_filt_out.tab" ftype="tabular"/>
398 <param name="mode" value="ft" />
399 <param name="samps" value="rudney_samples.tab" ftype="tabular"/>
400 <param name="plottype" value="ft_dist" />
401 <param name="meancol" value="NS_mean" />
402 <param name="whichway" value="f_dist" />
403 <param name="id_or_name" value="id" />
404 <param name="id" value="1301" />
405 <param name="target_onto" value="bp" />
406 <output name="wrapped_outfile">
407 <assert_contents>
408 <has_text text="To download the image" />
409 </assert_contents>
410 </output>
411 </test>
412 </tests>
413 <help><![CDATA[
414 metaQuantome viz
415 ===================
416
417 The *viz* module is the final step in the metaQuantome analysis workflow.
418 The available visualizations are:
419
420 - bar plot
421 - volcano plot
422 - heatmap
423 - PCA plot
424
425 Please consult the manuscript for full details on each of these plots.
426
427 Questions, Comments, Problems, Kudos
428 --------------------------------------
429
430 Please file any issues at https://github.com/galaxyproteomics/tools-galaxyp/issues.
431 ]]></help>
432 <expand macro="citations" />
433 </tool>