comparison freyja_aggregate_plot.xml @ 0:0ceb9fb0f4ce draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/freyja commit 2036e233d159a5c4b3b06ce6a681531259098f73
author iuc
date Thu, 28 Jul 2022 09:25:04 +0000
parents
children 1f89eeba299a
comparison
equal deleted inserted replaced
-1:000000000000 0:0ceb9fb0f4ce
1 <tool id="freyja_aggregate_plot" name="Freyja: Aggregate and visualize"
2 version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@"
3 profile="@PROFILE@">
4 <description>
5 demixed results
6 </description>
7 <macros>
8 <import>macros.xml</import>
9 </macros>
10 <expand macro="biotools"/>
11 <expand macro="requirements"/>
12 <expand macro="version"/>
13 <command detect_errors="exit_code"><![CDATA[
14 #if $need_aggregation.choice == 'yes'
15 #set demix_dir = 'demix_outputs/'
16 #set file_paths1 = []
17 mkdir -p demix_outputs &&
18 #for $input_file in $demix_file
19 #set $file_path = $demix_dir + $input_file.element_identifier
20 ln -s '$input_file' '$file_path' &&
21 $file_paths1.append($file_path)
22 #end for
23 freyja aggregate
24 '$demix_dir'
25 --output aggregated.tsv
26 #if $plot_format.choice != 'none'
27 &&
28 #end if
29 #end if
30 @PLOT_AND_DASH_COMMAND@
31 ]]></command>
32 <inputs>
33 <conditional name="need_aggregation">
34 <param name="choice" type="select"
35 label="Aggregate demixed data or provide aggregated data file?">
36 <option value="yes">aggregate demixed data</option>
37 <option value="no">provide aggregated data file</option>
38 </param>
39 <when value="yes">
40 <param name="demix_file" type="data" format="tabular" multiple="true"
41 label="Lineages abundances summary file(s)" help="One file per one sample."/>
42 </when>
43 <when value="no">
44 <param name="tsv_aggregated" type="data" format="tabular"
45 label="Provide aggregated data"/>
46 </when>
47 </conditional>
48 <conditional name="plot_format">
49 <param name="choice" type="select" label="Report(s) to generate">
50 <option value="plot">non-interactive plot</option>
51 <option value="dash">interactive dashboard (html)</option>
52 <option value="plot_and_dash">plot and dashboard</option>
53 <option value="none">no plots, just aggregated data table</option>
54 </param>
55 <when value="plot">
56 <conditional name="need_metadata">
57 <param name="choice" type="select"
58 label="Provide a sample metadata file for plotting data over time?">
59 <option value="yes">Yes</option>
60 <option value="no">No</option>
61 </param>
62 <when value="yes">
63 <param name="csv_meta" type="data" format="csv"
64 label="Provide time(s) metadata file"
65 help="See info box below to learn more about the form of meta-file. Accepts only CSV (.csv) files"/>
66 <param name="interval" type="select" label="Choose interval" display="radio"
67 help="Used for pdf format.">
68 <option value="MS" selected="true">month bins</option>
69 <option value="D">day bins</option>
70 </param>
71 </when>
72 <when value="no"/>
73 </conditional>
74 </when>
75 <when value="dash">
76 <param name="csv_meta" type="data" format="csv"
77 label="Provide sample(s) metadata file"
78 help="See info box below to learn more about the form of meta-file. Accepts only CSV (.csv) files"/>
79 <param name="plot_title" type="text" value="" optional="true" label="Title"/>
80 <param name="plot_intro" type="text" value="" optional="true" label="Introduction"/>
81 </when>
82 <when value="plot_and_dash">
83 <param name="csv_meta" type="data" format="csv"
84 label="Provide sample(s)/time(s) metadata file"
85 help="See info box below to learn more about the form of meta-file. Accepts only CSV (.csv) files"/>
86 <param name="plot_title" type="text" value="" optional="true" label="Title"
87 help="Used for interactive dashboard."/>
88 <param name="plot_intro" type="text" value="" optional="true" label="Introduction"
89 help="Used for interactive dashboard."/>
90 <param name="interval" type="select" label="Choose interval" display="radio"
91 help="Used for pdf non-interactive plot.">
92 <option value="MS" selected="true">month bins</option>
93 <option value="D">day bins</option>
94 </param>
95 </when>
96 <when value="none"/>
97 </conditional>
98 </inputs>
99 <outputs>
100 <!-- outputs for aggregate command -->
101 <data name="aggregated" format="tabular"
102 label="${tool.name} on ${on_string}: Aggregated data"
103 from_work_dir="aggregated.tsv">
104 <filter>need_aggregation['choice'] == 'yes'</filter>
105 </data>
106 <!-- outputs for dash command -->
107 <data name="abundances_dashboard" format="html"
108 label="${tool.name} on ${on_string}: Lineages abundances dashboard"
109 from_work_dir="abundances_dashboard.html">
110 <filter>plot_format['choice'] == 'dash' or plot_format['choice'] == 'plot_and_dash'
111 </filter>
112 </data>
113 <!-- outputs for plot command -->
114 <data name="abundances_plot" format="pdf"
115 label="${tool.name} on ${on_string}: Lineages abundances plot"
116 from_work_dir="abundances_plot.pdf">
117 <filter>plot_format['choice'] == 'plot' or plot_format['choice'] == 'plot_and_dash'
118 </filter>
119 </data>
120 </outputs>
121 <tests>
122 <!-- Test 01: aggregate command -->
123 <test expect_num_outputs="1">
124 <conditional name="need_aggregation">
125 <param name="choice" value="yes"/>
126 <param name="demix_file"
127 value="abundances.tsv,abundances2.tsv,abundances3.tsv,abundances4.tsv"/>
128 </conditional>
129 <conditional name="plot_format">
130 <param name="choice" value="none"/>
131 </conditional>
132 <output name="aggregated" ftype="tabular">
133 <assert_contents>
134 <has_text text="summarized"/>
135 <has_text text="abundances"/>
136 <has_text text="B.1.617.2"/>
137 </assert_contents>
138 </output>
139 </test>
140 <!-- Test 02: dash command -->
141 <test expect_num_outputs="1">
142 <conditional name="need_aggregation">
143 <param name="choice" value="no"/>
144 <param name="tsv_aggregated" value="bunch_of_files.tsv"/>
145 </conditional>
146 <conditional name="plot_format">
147 <param name="choice" value="dash"/>
148 <param name="csv_meta" value="csv_sample_meta.csv"/>
149 <param name="plot_title" value="This is title"/>
150 <param name="plot_intro" value="Local WW Dashboard"/>
151 </conditional>
152 <output name="abundances_dashboard" ftype="html">
153 <assert_contents>
154 <has_text text="Local WW Dashboard"/>
155 </assert_contents>
156 </output>
157 </test>
158 <!-- Test 03: plot command -->
159 <test expect_num_outputs="1">
160 <conditional name="need_aggregation">
161 <param name="choice" value="no"/>
162 <param name="tsv_aggregated" value="bunch_of_files.tsv"/>
163 </conditional>
164 <conditional name="plot_format">
165 <param name="choice" value="plot"/>
166 <conditional name="need_metadata">
167 <param name="choice" value="yes"/>
168 <param name="csv_meta" value="times_metadata.csv"/>
169 <param name="interval" value="D"/>
170 </conditional>
171 </conditional>
172 <output name="abundances_plot" ftype="pdf">
173 <assert_contents>
174 <has_text text="Matplotlib"/>
175 </assert_contents>
176 </output>
177 </test>
178 <!-- Test 04: aggregate and dash commands -->
179 <test expect_num_outputs="2">
180 <conditional name="need_aggregation">
181 <param name="choice" value="yes"/>
182 <param name="demix_file" value="abundances.tsv,abundances2.tsv,abundances3.tsv"/>
183 </conditional>
184 <conditional name="plot_format">
185 <param name="choice" value="dash"/>
186 <param name="csv_meta" value="csv_sample_meta2.csv"/>
187 <param name="plot_title" value="This is title"/>
188 <param name="plot_intro" value="Local WW Dashboard"/>
189 </conditional>
190 <output name="aggregated" ftype="tabular">
191 <assert_contents>
192 <has_text text="summarized"/>
193 <has_text text="abundances"/>
194 <has_text text="B.1.617.2"/>
195 </assert_contents>
196 </output>
197 <output name="abundances_dashboard" ftype="html">
198 <assert_contents>
199 <has_text text="Local WW Dashboard"/>
200 </assert_contents>
201 </output>
202 </test>
203 <!-- Test 05: aggregate and plot commands -->
204 <test expect_num_outputs="2">
205 <conditional name="need_aggregation">
206 <param name="choice" value="yes"/>
207 <param name="demix_file" value="abundances.tsv,abundances2.tsv,abundances3.tsv"/>
208 </conditional>
209 <conditional name="plot_format">
210 <param name="choice" value="plot"/>
211 <conditional name="need_metadata">
212 <param name="choice" value="yes"/>
213 <param name="csv_meta" value="csv_sample_meta2.csv"/>
214 <param name="interval" value="D"/>
215 </conditional>
216 </conditional>
217 <output name="aggregated" ftype="tabular">
218 <assert_contents>
219 <has_text text="summarized"/>
220 <has_text text="abundances"/>
221 <has_text text="B.1.617.2"/>
222 </assert_contents>
223 </output>
224 <output name="abundances_plot" ftype="pdf">
225 <assert_contents>
226 <has_text text="Matplotlib"/>
227 </assert_contents>
228 </output>
229 </test>
230 <!-- Test 06: aggregate, dash and plot commands -->
231 <test expect_num_outputs="3">
232 <conditional name="need_aggregation">
233 <param name="choice" value="yes"/>
234 <param name="demix_file" value="abundances.tsv,abundances2.tsv,abundances3.tsv"/>
235 </conditional>
236 <conditional name="plot_format">
237 <param name="choice" value="plot_and_dash"/>
238 <param name="csv_meta" value="csv_sample_meta2.csv"/>
239 <param name="plot_title" value="This is title"/>
240 <param name="plot_intro" value="Local WW Dashboard"/>
241 <param name="interval" value="D"/>
242 </conditional>
243 <output name="aggregated" ftype="tabular">
244 <assert_contents>
245 <has_text text="summarized"/>
246 <has_text text="abundances"/>
247 <has_text text="B.1.617.2"/>
248 </assert_contents>
249 </output>
250 <output name="abundances_plot" ftype="pdf">
251 <assert_contents>
252 <has_text text="Matplotlib"/>
253 </assert_contents>
254 </output>
255 <output name="abundances_dashboard" ftype="html">
256 <assert_contents>
257 <has_text text="Local WW Dashboard"/>
258 </assert_contents>
259 </output>
260 </test>
261 </tests>
262 <help><![CDATA[
263 @HELP_HEADER@
264
265 Information about **freyja aggregate** method
266 =============================================
267
268 Method for manipulating the "demixed" output files.
269
270 Outputs
271 -------
272
273 This resulting aggregated data can analyzed directly as a tsv file, or can be visualized using *freyja plot* and *freyja dash*.
274
275 Information about **freyja plot** method
276 ========================================
277
278 Method provides a fractional abundance estimate for all aggregated samples.
279
280 A **time(s) metadata CSV file** should have this form:
281
282 *Sample,sample_collection_datetime*
283
284 *sample_0.tsv,03/01/21*
285
286 *sample_1.tsv,03/03/21*
287
288 *sample_2.tsv,03/08/21*
289
290 *sample_3.tsv,03/10/21*
291
292 *sample_4.tsv,03/12/21*
293
294 *sample_5.tsv,03/14/21*
295
296 *sample_6.tsv,03/17/21*
297
298 *sample_7.tsv,03/20/21*
299
300 *sample_8.tsv,03/25/21*
301
302 *sample_9.tsv,03/30/21*
303
304 *sample_10.tsv,03/31/21*
305
306 *sample_11.tsv,04/04/21*
307
308
309 Information about **freyja dash** method
310 ========================================
311
312 Functionality to rapidly prepare a dashboard web page, directly from aggregated freyja output.
313
314 A **sample(s) metadata CSV file** should have this form:
315
316 *Sample,sample_collection_datetime,viral_load*
317
318 *sample_0.tsv,03/01/21,460326*
319
320 *sample_1.tsv,03/03/21,176645.1*
321
322 *sample_2.tsv,03/08/21,449891.7*
323
324 *sample_3.tsv,03/10/21,361699.5*
325
326 *sample_4.tsv,03/12/21,658923.9*
327
328 *sample_5.tsv,03/14/21,500432.8*
329
330 *sample_6.tsv,03/17/21,791406.4*
331
332 *sample_7.tsv,03/20/21,628119.9*
333
334 *sample_8.tsv,03/25/21,810673.9*
335
336 *sample_9.tsv,03/30/21,1263564.4*
337
338 *sample_10.tsv,03/31/21,1627556.3*
339
340 *sample_11.tsv,04/04/21,1528006.4*
341
342
343 ]]></help>
344 <expand macro="citations"/>
345 </tool>