Mercurial > repos > nml > csvtk_plot
comparison plot.xml @ 0:f370d221c284 draft default tip
"planemo upload for repository https://github.com/shenwei356/csvtk commit 3a97e1b79bf0c6cdd37d5c8fb497b85531a563ab"
author | nml |
---|---|
date | Tue, 19 May 2020 17:10:23 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f370d221c284 |
---|---|
1 <tool id="csvtk_plot" name="csvtk-plot" version="@VERSION@+@GALAXY_VERSION@"> | |
2 <description> histogram, line/scatter plot, or boxplot based on column</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 plot | |
14 | |
15 #if $plot_type.plot == "histogram" | |
16 hist | |
17 #elif $plot_type.plot == "boxplot" | |
18 box | |
19 #elif $plot_type.plot == "line" | |
20 line | |
21 #end if | |
22 | |
23 --num-cpus "\${GALAXY_SLOTS:-1}" | |
24 | |
25 ## Add additional flags as specified ## | |
26 ####################################### | |
27 $global_param.illegal_rows | |
28 $global_param.empty_rows | |
29 $global_param.header | |
30 $global_param.lazy_quotes | |
31 | |
32 ## Set Tabular input/output flag if first input is tabular ## | |
33 ############################################################# | |
34 #if $in_1.is_of_type("tabular"): | |
35 -t -T | |
36 #end if | |
37 | |
38 ## Set input files ## | |
39 ##################### | |
40 $in_1 | |
41 | |
42 ## Specific Plot Parameters ## | |
43 ############################## | |
44 #if $plot_type.plot == "histogram" | |
45 -f '$plot_type.column_text.in_text' | |
46 --color-index $plot_type.colour | |
47 | |
48 #elif $plot_type.plot == "boxplot" | |
49 -f '$plot_type.column_text.in_text' | |
50 $plot_type.horizontal | |
51 | |
52 #if $plot_type.group_field.select_group != "none" | |
53 -g '$plot_type.group_field.in_text' | |
54 #end if | |
55 | |
56 #if $plot_type.box_width | |
57 --box-width '$plot_type.box_width' | |
58 #end if | |
59 | |
60 #elif $plot_type.plot == "line" | |
61 $plot_type.scatter | |
62 -x '$plot_type.column_text.in_text_x' | |
63 -y '$plot_type.column_text.in_text_y' | |
64 | |
65 #if $plot_type.group_field.select_group != "none" | |
66 -g '$plot_type.group_field.in_text' | |
67 #end if | |
68 | |
69 $plot_type.label_location | |
70 | |
71 #end if | |
72 | |
73 ## General Plot Parameters ## | |
74 ############################# | |
75 | |
76 #if $plot_parameters.figure_height | |
77 --height '$plot_parameters.figure_height' | |
78 #end if | |
79 | |
80 #if $plot_parameters.figure_width | |
81 --width '$plot_parameters.figure_width' | |
82 #end if | |
83 | |
84 #if $plot_parameters.tick_width | |
85 --tick-width '$plot_parameters.tick_width' | |
86 #end if | |
87 | |
88 #if $plot_parameters.title | |
89 --title '$plot_parameters.title' | |
90 #end if | |
91 | |
92 #if $plot_parameters.x_label | |
93 --xlab '$plot_parameters.x_label' | |
94 #end if | |
95 | |
96 #if $plot_parameters.min_x | |
97 --x-min '$plot_parameters.min_x' | |
98 #end if | |
99 | |
100 #if $plot_parameters.max_x | |
101 --x-max '$plot_parameters.max_x' | |
102 #end if | |
103 | |
104 #if $plot_parameters.y_label | |
105 --ylab '$plot_parameters.y_label' | |
106 #end if | |
107 | |
108 #if $plot_parameters.min_y | |
109 --y-min '$plot_parameters.min_y' | |
110 #end if | |
111 | |
112 #if $plot_parameters.max_y | |
113 --y-max '$plot_parameters.max_y' | |
114 #end if | |
115 | |
116 ## To output ## | |
117 ############### | |
118 > plot.png | |
119 | |
120 ]]></command> | |
121 <inputs> | |
122 <expand macro="singular_input"/> | |
123 <conditional name="plot_type"> | |
124 <param name="plot" type="select" label="Select plot type"> | |
125 <option value="histogram">Histogram</option> | |
126 <option value="boxplot">Boxplot</option> | |
127 <option value="line">Line/Scatter</option> | |
128 </param> | |
129 <when value="histogram"> | |
130 <expand macro="plot_field" /> | |
131 <param name="colour" type="integer" | |
132 min="1" max="7" | |
133 value="1" | |
134 argument="--color-index" | |
135 label="Select colour scheme" | |
136 help="Choose a number from 1-7" | |
137 /> | |
138 </when> | |
139 <when value="boxplot" > | |
140 <expand macro="plot_field" /> | |
141 <expand macro="groups_input" /> | |
142 <param type="boolean" name="horizontal" label="Horizontal Box Plot" argument="--horiz" | |
143 checked="false" | |
144 falsevalue="" | |
145 truevalue="--horiz" | |
146 /> | |
147 <param name="box_width" type="float" | |
148 label="Box Width (Optional)" | |
149 argument="--box-width" | |
150 optional="true" | |
151 /> | |
152 </when> | |
153 <when value="line"> | |
154 <param name="scatter" type="boolean" label="Scatter Plot" argument="--scatter" | |
155 checked="false" | |
156 falsevalue="" | |
157 truevalue="--scatter" | |
158 help="Plot only points, no lines" | |
159 /> | |
160 <conditional name="column_text" > | |
161 <param type="select" name="select" label="Select input data columns for the X and Y axis based on:" > | |
162 <option value="string">Column Name</option> | |
163 <option value="column">Column Number</option> | |
164 </param> | |
165 <when value="column"> | |
166 <param type="data_column" name="in_text_x" | |
167 data_ref="in_1" | |
168 multiple="false" | |
169 label="X-axis data column" | |
170 /> | |
171 <param type="data_column" name="in_text_y" | |
172 data_ref="in_1" | |
173 multiple="false" | |
174 label="Y-axis data column" | |
175 /> | |
176 </when> | |
177 <when value="string"> | |
178 <param type="text" name="in_text_x" | |
179 optional="false" | |
180 label="X-axis data column" | |
181 help="Can use column name or column number"> | |
182 <expand macro="text_sanitizer" /> | |
183 </param> | |
184 <param type="text" name="in_text_y" | |
185 optional="false" | |
186 label="Y-axis data column" | |
187 help="Can use column name or column number"> | |
188 </param> | |
189 </when> | |
190 </conditional> | |
191 <expand macro="groups_input" /> | |
192 <param name="label_location" type="select" label="Label Location" | |
193 help="Only displays legend if a groups column is set"> | |
194 <option value="--legend-left">Left edge of plot</option> | |
195 <option value="--legend-top">Top edge of plot</option> | |
196 </param> | |
197 </when> | |
198 </conditional> | |
199 <expand macro="global_plot_parameters" /> | |
200 <expand macro="global_parameters" /> | |
201 </inputs> | |
202 <outputs> | |
203 <data format="png" from_work_dir="plot.png" name="out_plot" label="${in_1.name} ${plot_type.plot}" /> | |
204 </outputs> | |
205 <tests> | |
206 <test> | |
207 <param name="in_1" value="plot.csv" /> | |
208 <conditional name="plot_type"> | |
209 <param name="plot" value="histogram" /> | |
210 <conditional name="column_text"> | |
211 <param name="select" value="string" /> | |
212 <param name="in_text" value="2" /> | |
213 </conditional> | |
214 <param name="colour" value="2" /> | |
215 </conditional> | |
216 <output name="out_plot" value="plot.png" ftype="png" compare="sim_size" delta="20000" /> | |
217 </test> | |
218 <test> | |
219 <param name="in_1" value="plot.csv" /> | |
220 <conditional name="plot_type"> | |
221 <param name="plot" value="boxplot" /> | |
222 <conditional name="column_text"> | |
223 <param name="select" value="column" /> | |
224 <param name="in_text" value="2" /> | |
225 </conditional> | |
226 <conditional name="group_field"> | |
227 <param name="select_group" value="string" /> | |
228 <param name="in_text" value="1" /> | |
229 </conditional> | |
230 <param name="horizontal" value="true" /> | |
231 <param name="box_width" value="50.5" /> | |
232 </conditional> | |
233 <output name="out_plot" value="plot_box.png" compare="sim_size" delta="20000" /> | |
234 </test> | |
235 <test> | |
236 <param name="in_1" value="plot.csv" /> | |
237 <conditional name="plot_type"> | |
238 <param name="plot" value="line" /> | |
239 <param name="scatter" value="true" /> | |
240 <conditional name="column_text"> | |
241 <param name="select" value="column" /> | |
242 <param name="in_text_x" value="2" /> | |
243 <param name="in_text_y" value="3" /> | |
244 </conditional> | |
245 <conditional name="group_field"> | |
246 <param name="select_group" value="string" /> | |
247 <param name="in_text" value="1" /> | |
248 </conditional> | |
249 </conditional> | |
250 <output name="out_plot" value="plot_scatter.png" compare="sim_size" delta="20000" /> | |
251 </test> | |
252 <test> | |
253 <param name="in_1" value="plot.csv" /> | |
254 <conditional name="plot_type"> | |
255 <param name="plot" value="line" /> | |
256 <param name="scatter" value="false" /> | |
257 <conditional name="column_text"> | |
258 <param name="select" value="column" /> | |
259 <param name="in_text_x" value="2" /> | |
260 <param name="in_text_y" value="3" /> | |
261 </conditional> | |
262 <conditional name="group_field"> | |
263 <param name="select_group" value="string" /> | |
264 <param name="in_text" value="1" /> | |
265 </conditional> | |
266 <param name="label_location" value="--legend-top" /> | |
267 </conditional> | |
268 <section name="plot_parameters"> | |
269 <param name="figure_height" value="10.1" /> | |
270 <param name="figure_width" value="6.6" /> | |
271 <param name="tick_width" value="2.1" /> | |
272 <param name="title" value="Test" /> | |
273 <param name="x_label" value="Potentially Broken" /> | |
274 <param name="min_x" value="1.1" /> | |
275 <param name="max_x" value="109.1" /> | |
276 <param name="y_label" value="How High Can We Go?" /> | |
277 <param name="min_y" value="-10.4" /> | |
278 <param name="max_y" value="141.9" /> | |
279 </section> | |
280 <output name="out_plot" value="line_all_param.png" compare="sim_size" delta="20000" /> | |
281 </test> | |
282 </tests> | |
283 <help><![CDATA[ | |
284 | |
285 Csvtk - Plot Help | |
286 ----------------- | |
287 | |
288 Info | |
289 #### | |
290 | |
291 Use Csvtk-Plot to plot histograms, line plots / scatter plots, or boxplots. | |
292 | |
293 Specify a column or a couple of columns from an input CSV/TSV dataset to generate wanted plots fast. | |
294 | |
295 .. class:: warningmark | |
296 | |
297 Single quotes are not allowed in text inputs! | |
298 | |
299 @HELP_INPUT_DATA@ | |
300 | |
301 | |
302 @HELP_END_STATEMENT@ | |
303 | |
304 | |
305 ]]></help> | |
306 <expand macro="citations" /> | |
307 </tool> |