Mercurial > repos > iuc > ampvis2_otu_network
comparison macros.xml @ 0:4bcb464fb3f3 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ampvis2 commit 7c0ecbffdb5e993f5af7e3b52c424c2761fb91d3"
author | iuc |
---|---|
date | Mon, 04 Apr 2022 10:24:03 +0000 |
parents | |
children | 354d645455cd |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4bcb464fb3f3 |
---|---|
1 <macros> | |
2 <token name="@TOOL_VERSION@">2.7.17</token> | |
3 <token name="@VERSION_SUFFIX@">0</token> | |
4 <token name="@PROFILE@">22.01</token> | |
5 <xml name="header"> | |
6 <xrefs> | |
7 <xref type="bio.tools">ampvis</xref> | |
8 </xrefs> | |
9 <requirements> | |
10 <requirement type="package" version="@TOOL_VERSION@">r-ampvis2</requirement> | |
11 <requirement type="package" version="2.1.1">r-readr</requirement> | |
12 </requirements> | |
13 <version_command><![CDATA[ | |
14 echo $(R --version | grep "R version")", ampvis2 version" $(R --vanilla --slave -e "library(ampvis2, quietly = TRUE); sessionInfo()\$otherPkgs\$ampvis2\$Version" 2> /dev/null | grep -v -i "WARNING: ") | |
15 ]]></version_command> | |
16 | |
17 </xml> | |
18 <xml name="citations"> | |
19 <citations> | |
20 <citation type="doi">10.1101/299537</citation> | |
21 <yield/> | |
22 </citations> | |
23 </xml> | |
24 | |
25 <xml name="rds_input_macro"> | |
26 <param argument="data" type="data" format="ampvis2" label="Ampvis2 RDS dataset" help="Generated with ampvis2: load"/> | |
27 </xml> | |
28 | |
29 <xml name="rds_metadata_input_macro" token_metadata_optional="true"> | |
30 <expand macro="rds_input_macro"/> | |
31 <param name="metadata_list" type="data" optional="@METADATA_OPTIONAL@" format="tabular" label="Metadata list"> | |
32 <validator type="expression" message="The metadatalist file must have 3 columns"><![CDATA[value.metadata.columns == 4]]></validator> | |
33 </param> | |
34 </xml> | |
35 | |
36 <token name="@SAVE_TAX_LIST@"><![CDATA[ | |
37 for(level in colnames(data\$tax)){ | |
38 for(u in unique(data\$tax[level])){ | |
39 write(u, file="$taxonomy_list_out", append=T) | |
40 } | |
41 } | |
42 ]]></token> | |
43 | |
44 <token name="@SAVE_METADATA_LIST@"><![CDATA[ | |
45 classes <- sapply(data\$metadata, class) | |
46 for(name in names(data\$metadata)){ | |
47 ## check if it is the column containing the sample names | |
48 ## the additional column in the ist file can the be used | |
49 ## to filter SampleIDs from select inputs | |
50 ## (check for character columns only .. since data in the column is otherwise converted to the corresponding type .. which fails) | |
51 if(classes[[name]] == "character" && all(data\$metadata[[name]] == rownames(data\$metadata))){ | |
52 sample_names <- TRUE; | |
53 }else{ | |
54 sample_names <- FALSE; | |
55 } | |
56 for(m in unique(data\$metadata[[name]])){ | |
57 write(paste(name, m, sample_names, classes[[name]], sep="\t"), file="$metadata_list_out", append=T); | |
58 } | |
59 } | |
60 ]]></token> | |
61 | |
62 <!-- defaults can be set by redefining an on option with selected="true" --> | |
63 <xml name="taxlevel_macro" token_argument="" token_multiple="false" token_optional="false" token_label="" token_help=""> | |
64 <param argument="@ARGUMENT@" type="select" optional="@OPTIONAL@" multiple="@MULTIPLE@" label="@LABEL@" help="@HELP@"> | |
65 <option value="OTU">OTU/ASV</option> | |
66 <option value="Species">Species</option> | |
67 <option value="Genus">Genus</option> | |
68 <option value="Family">Family</option> | |
69 <option value="Order">Order</option> | |
70 <option value="Class">Class</option> | |
71 <option value="Phylum">Phylum</option> | |
72 <option value="Kingdom">Kingdom</option> | |
73 <yield/> | |
74 </param> | |
75 </xml> | |
76 | |
77 <xml name="tax_empty_macro"> | |
78 <param argument="tax_empty" type="select" label="How to show OTUs without taxonomic information"> | |
79 <option value="remove">Remove OTUs without taxonomic information</option> | |
80 <option value="best" selected="true">Use the best classification possible</option> | |
81 <option value="OTU">Display the OTU name</option> | |
82 </param> | |
83 </xml> | |
84 | |
85 <token name="@TAX_SHOW@"><![CDATA[ | |
86 #if $tax_show_cond.tax_show_sel == "number" | |
87 tax_show = $tax_show_cond.tax_show, | |
88 #else | |
89 #set tax_show_list='c("' + '", "'.join(str($tax_show_cond.tax_show).split(",")) + '")' | |
90 tax_show = $tax_show_list | |
91 #end if | |
92 ]]></token> | |
93 <xml name="tax_show_macro" token_value=""> | |
94 <conditional name="tax_show_cond"> | |
95 <param name="tax_show_sel" type="select" label="Limit the number of shown taxa"> | |
96 <option value="number">Select a number of taxa to show</option> | |
97 <option value="explicit">Manually select taxa to show</option> | |
98 </param> | |
99 <when value="number"> | |
100 <param argument="tax_show" type="integer" value="@VALUE@" min="1" label="Number of taxa to show"/> | |
101 </when> | |
102 <when value="explicit"> | |
103 <param name="taxonomy_list" format="tabular" type="data" optional="false" label="Taxonomy list" help="Generated with ampvis2: load"/> | |
104 <param argument="tax_show" type="select" multiple="true" optional="false" label="Taxa to show"> | |
105 <options from_dataset="taxonomy_list"> | |
106 <column name="name" index="0"/> | |
107 <column name="value" index="0"/> | |
108 <!-- TODO filter by tax_aggregate level? --> | |
109 </options> | |
110 </param> | |
111 </when> | |
112 </conditional> | |
113 </xml> | |
114 | |
115 <xml name="metadata_select" token_quote="__" tokens="argument,label" token_an="argument" token_optional="true" token_multiple="false" token_help=""> | |
116 <param __AN__="__ARGUMENT__" type="select" optional="__OPTIONAL__" multiple="__MULTIPLE__" label="__LABEL__" help="In order to select values a metadata list needs to be selected first. __HELP__"> | |
117 <options from_dataset="metadata_list"> | |
118 <column name="name" index="0"/> | |
119 <column name="value" index="0"/> | |
120 <filter type="unique_value" column="0"/> | |
121 <yield name="options"/> | |
122 </options> | |
123 <yield/> | |
124 </param> | |
125 </xml> | |
126 | |
127 <xml name="metadata_select_discrete" tokens="argument,label" token_optional="true" token_multiple="false" token_help=""> | |
128 <expand macro="metadata_select" argument="@ARGUMENT@" optional="@OPTIONAL@" multiple="@MULTIPLE@" label="@LABEL@" help="@HELP@"> | |
129 <token name="options"> | |
130 <filter type="static_value" column="3" value="numeric" keep="false"/> | |
131 </token> | |
132 <yield/> | |
133 </expand> | |
134 </xml> | |
135 | |
136 <xml name="metadata_select_numeric" tokens="argument,label" token_optional="true" token_multiple="false" token_help=""> | |
137 <expand macro="metadata_select" argument="@ARGUMENT@" optional="@OPTIONAL@" multiple="@MULTIPLE@" label="@LABEL@" help="@HELP@"> | |
138 <token name="options"> | |
139 <filter type="static_value" column="3" value="character" keep="false"/> | |
140 <filter type="static_value" column="3" value="Date" keep="false"/> | |
141 </token> | |
142 <yield/> | |
143 </expand> | |
144 </xml> | |
145 | |
146 <xml name="metadata_select_date" tokens="argument,label" token_optional="true" token_multiple="false" token_help=""> | |
147 <expand macro="metadata_select" argument="@ARGUMENT@" optional="@OPTIONAL@" multiple="@MULTIPLE@" label="@LABEL@" help="@HELP@"> | |
148 <token name="options"> | |
149 <filter type="static_value" column="3" value="Date" keep="true"/> | |
150 </token> | |
151 <yield/> | |
152 </expand> | |
153 </xml> | |
154 | |
155 <xml name="metadata_sample_select" token_argument=""> | |
156 <conditional name="@ARGUMENT@_cond"> | |
157 <param name="@ARGUMENT@_sel" type="select"> | |
158 <option value="no">No</option> | |
159 <option value="variable">Metadata variable</option> | |
160 <option value="sample">Specific sample</option> | |
161 </param> | |
162 <when value="no"/> | |
163 <when value="variable"> | |
164 <expand macro="metadata_select" argument="@ARGUMENT@" label="Metadata variable"/> | |
165 </when> | |
166 <when value="sample"> | |
167 <param argument="@ARGUMENT@" type="select" optional="true"> | |
168 <options from_dataset="metadata_list"> | |
169 <column name="name" index="1"/> | |
170 <column name="value" index="1"/> | |
171 <filter type="static_value" value="TRUE" column="2"/> <!-- filter samples --> | |
172 <filter type="unique_value" column="1"/> | |
173 </options> | |
174 </param> | |
175 </when> | |
176 </conditional> | |
177 </xml> | |
178 | |
179 <xml name="taxonomy_select_macro" token_argument="" token_optional="false" token_multiple="true"> | |
180 <param argument="@ARGUMENT@" type="select" optional="@OPTIONAL@" multiple="@MULTIPLE@"> | |
181 <options from_dataset="taxonomy_list"> | |
182 <column name="name" index="0"/> | |
183 <column name="value" index="0"/> | |
184 <filter type="unique_value" column="0"/> | |
185 </options> | |
186 <yield/> | |
187 </param> | |
188 </xml> | |
189 | |
190 <xml name="facet_scales_macro" token_argument="" token_label="Scales of the facets" token_help=""> | |
191 <param argument="@ARGUMENT@" type="select" optional="true" label="@LABEL@" help="@HELP@"> | |
192 <option value="fixed">Same scale</option> | |
193 <option value="free">Free scale</option> | |
194 <option value="free_x">Free x-scale</option> | |
195 <option value="free_y">Free y-scale</option> | |
196 </param> | |
197 </xml> | |
198 | |
199 <token name="@OUTPUT_TOKEN@"> | |
200 ggsave("$plot", | |
201 print(plot), | |
202 device="$output_options.out_format" | |
203 #if str($output_options.plot_width) != '' | |
204 , width = $output_options.plot_width | |
205 #end if | |
206 #if str($output_options.plot_height) != '' | |
207 , height = $output_options.plot_height | |
208 #end if | |
209 ) | |
210 </token> | |
211 <xml name="out_macro" token_name="plot" token_label=""> | |
212 <data name="@NAME@" format="pdf" label="${tool.name} on ${on_string}@LABEL@"> | |
213 <yield/> | |
214 <change_format> | |
215 <when input="output_options.out_format" value="png" format="png" /> | |
216 <when input="output_options.out_format" value="svg" format="svg" /> | |
217 </change_format> | |
218 </data> | |
219 </xml> | |
220 <xml name="out_format_macro"> | |
221 <section name="output_options" title="Output options" expanded="false"> | |
222 <param name="out_format" type="select" label="Output format"> | |
223 <option value="pdf" selected="true">PDF</option> | |
224 <option value="png">PNG</option> | |
225 <option value="svg">SVG</option> | |
226 <yield/> | |
227 </param> | |
228 <param name="plot_width" type="float" value="" min="1" optional="true" label="Plot width in cm"/> | |
229 <param name="plot_height" type="float" value="" min="1" optional="true" label="Plot height in cm"/> | |
230 </section> | |
231 </xml> | |
232 | |
233 <token name="@RAREFY_TOKEN@"> | |
234 #if str($rarefy) != "" | |
235 , rarefy = $rarefy | |
236 #end if | |
237 </token> | |
238 <xml name="rarefy_macro" token_help=""> | |
239 <param argument="rarefy" type="integer" optional="true" value="" min="0" label="Rarefy species richness to this value" help="@HELP@"/> | |
240 </xml> | |
241 | |
242 <xml name="normalise_macro" token_checked="false"> | |
243 <param argument="normalise" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="@CHECKED@" label="Normalise read counts" help="Transform the OTU read counts to be in percent per sample."/> | |
244 </xml> | |
245 | |
246 <token name="@HELP_RDS_INPUT@"> | |
247 An ampvis2 RDS dataset obtained by the ``ampvis2: load`` tool (or ``ampvis2: mergereplicates`` or one of the | |
248 ``ampvis2: subset ...`` tools). | |
249 </token> | |
250 <token name="@HELP_METADATA_LIST_INPUT@"> | |
251 The metadata list output of the ``ampvis2: load`` tool (or ``ampvis2: mergereplicates`` or the | |
252 ``ampvis2: subset sample`` tool). This input is only used for providing | |
253 values to the parameters alowing to select metadata variables or values. | |
254 </token> | |
255 | |
256 <token name="@HELP_RELATIVE_ABUNDANCES@"> | |
257 Preserving relative abundances in a subset of larger data | |
258 ========================================================= | |
259 | |
260 By default the raw read counts in the abundance matrix are normalised | |
261 (transformed to percentages) by some ampvis2 plotting tools (for | |
262 example ``ampvis2: heatmap``, ``ampvis2: timeseries``, and more). | |
263 If this is applied to data generated by one of the ``ampvis2: subset ...`` tools | |
264 this means that the relative | |
265 abundances shown will be calculated based on the remaining taxa after the | |
266 subset, not including the removed taxa, if any. To circumvent this, enable | |
267 ``normalise`` when subsetting with the ``ampvis2: subset ...``` tools, | |
268 and then disable ``normalise`` in the plotting tool. This will | |
269 transform the OTU counts to relative abundances BEFORE the subset. | |
270 </token> | |
271 </macros> |