comparison ggplot_point.xml @ 15:f87634b12749 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ggplot2 commit 57b86418a4f032a5664b8dc1c9585a11be629158
author iuc
date Thu, 15 May 2025 13:02:15 +0000
parents 5298e06f14f9
children
comparison
equal deleted inserted replaced
14:5298e06f14f9 15:f87634b12749
1 <tool id="ggplot2_point" name="Scatterplot with ggplot2" version="@TOOL_VERSION@+galaxy1" profile="20.01"> 1 <tool id="ggplot2_point" name="Scatterplot with ggplot2" version="@TOOL_VERSION@+galaxy2" profile="23.0">
2 <macros> 2 <macros>
3 <import>macros.xml</import> 3 <import>macros.xml</import>
4 <token name="@SIMPLE_GGLINE@">gg_line = geom_line(size=1, alpha=1, gg_factor)</token> 4 <token name="@SIMPLE_GGLINE@">gg_line = geom_line(size=1, alpha=1, gg_factor)</token>
5 </macros> 5 </macros>
6 <expand macro="bio_tools"/> 6 <expand macro="bio_tools"/>
22 22
23 @THEME@ 23 @THEME@
24 24
25 @LEGEND@ 25 @LEGEND@
26 26
27 input <- read.csv('$input1', sep='\t', header=TRUE) 27 input <- read.csv('$input1', sep='\t')
28 28
29 ## renaming columns so ggplot can use them 29 ## renaming columns so ggplot can use them
30 names(input)[$xplot] <- "xcol" 30 names(input)[$xplot] <- "xcol"
31 names(input)[$yplot] <- "ycol" 31 names(input)[$yplot] <- "ycol"
32 32
124 #elif $adv.type_conditional.type_options == "lines" 124 #elif $adv.type_conditional.type_options == "lines"
125 gg_point = NULL 125 gg_point = NULL
126 #end if 126 #end if
127 127
128 #this is the actual ggplot command to make the final plot(s) 128 #this is the actual ggplot command to make the final plot(s)
129 plot_out <- ggplot(input, aes(xcol, ycol)) + gg_point + gg_line + gg_facet + 129 plot_out <- ggplot(input, aes_string(x=names(input)[$xplot], y=names(input)[$yplot])) + gg_point + gg_line + gg_facet +
130 gg_theme + gg_scalex + gg_scaley + color_scale + gg_legend + ggtitle('$title') + xlab('$xlab') + ylab('$ylab')+ 130 gg_theme + gg_scalex + gg_scaley + color_scale + gg_legend + ggtitle('$title') + xlab('$xlab') + ylab('$ylab')+
131 gg_axistitle + gg_axistext + gg_plottitle + gg_gridline 131 gg_axistitle + gg_axistext + gg_plottitle + gg_gridline
132 132
133 @SAVE_OUTPUT@ 133 @SAVE_OUTPUT@
134 ]]></configfile> 134 ]]></configfile>
135 </configfiles> 135 </configfiles>
136 <inputs> 136 <inputs>
137 <param name="input1" type="data" format="tabular" label="Input in tabular format" /> 137 <param name="input1" type="data" format="tabular" label="Input in tabular format" />
138 <param name="xplot" type="integer" value="8" label="Column to plot on x-axis" /> 138
139 <param name="yplot" type="integer" value="9" label="Column to plot on y-axis" /> 139 <conditional name="cols">
140 <param name="header" type="select" label="Does the dataset have a header?" help="If the table has a header, columns can be selected based on the name.">
141 <option value="yes" selected="true">yes</option>
142 <option value="no">no</option>
143 </param>
144 <when value="yes">
145 <param name="xplot" type="data_column" data_ref="input1" use_header_names="true" label="Column to plot on x-axis" />
146 <param name="yplot" type="data_column" data_ref="input1" use_header_names="true" label="Column to plot on y-axis" />
147 </when>
148 <when value="no">
149 <param name="xplot" type="data_column" data_ref="input1" label="Column to plot on x-axis" />
150 <param name="yplot" type="data_column" data_ref="input1" label="Column to plot on y-axis" />
151 </when>
152 </conditional>
153
140 154
141 <expand macro="title" /> 155 <expand macro="title" />
142 <expand macro="xy_lab" /> 156 <expand macro="xy_lab" />
143 <section name="adv" title="Advanced options"> 157 <section name="adv" title="Advanced options">
144 <conditional name="type_conditional"> 158 <conditional name="type_conditional">
205 </outputs> 219 </outputs>
206 <tests> 220 <tests>
207 <test expect_num_outputs="2"> 221 <test expect_num_outputs="2">
208 <param name="input1" value="mtcars.txt" ftype="tabular" /> 222 <param name="input1" value="mtcars.txt" ftype="tabular" />
209 <param name="additional_output_format" value="pdf" /> 223 <param name="additional_output_format" value="pdf" />
224 <param name="xplot" value="8"/>
225 <param name="yplot" value="9"/>
210 <output name="output2" file="ggplot_point_result1.pdf" compare="sim_size" /> 226 <output name="output2" file="ggplot_point_result1.pdf" compare="sim_size" />
211 </test> 227 </test>
212 <!-- Test text options--> 228 <!-- Test text options-->
213 <test expect_num_outputs="2"> 229 <test expect_num_outputs="2">
214 <param name="input1" value="mtcars.txt" ftype="tabular" /> 230 <param name="input1" value="mtcars.txt" ftype="tabular" />
231 <conditional name="cols">
232 <param name="header" value="no"/>
233 </conditional>
234 <param name="xplot" value="8"/>
235 <param name="yplot" value="9"/>
215 <section name="adv"> 236 <section name="adv">
216 <conditional name="type_conditional"> 237 <conditional name="type_conditional">
217 <param name="type_options" value="points"/> 238 <param name="type_options" value="points"/>
218 <conditional name="points"> 239 <conditional name="points">
219 <param name="pointoptions" value="default"/> 240 <param name="pointoptions" value="default"/>
228 <output name="output2" file="ggplot_point_result2.pdf" compare="sim_size" /> 249 <output name="output2" file="ggplot_point_result2.pdf" compare="sim_size" />
229 </test> 250 </test>
230 <!-- Test lines option --> 251 <!-- Test lines option -->
231 <test expect_num_outputs="2"> 252 <test expect_num_outputs="2">
232 <param name="input1" value="mtcars.txt" ftype="tabular" /> 253 <param name="input1" value="mtcars.txt" ftype="tabular" />
254 <param name="xplot" value="8"/>
255 <param name="yplot" value="9"/>
233 <section name="adv"> 256 <section name="adv">
234 <conditional name="type_conditional"> 257 <conditional name="type_conditional">
235 <param name="type_options" value="lines"/> 258 <param name="type_options" value="lines"/>
236 </conditional> 259 </conditional>
237 </section> 260 </section>
239 <output name="output2" file="ggplot_line_result1.pdf" compare="sim_size" /> 262 <output name="output2" file="ggplot_line_result1.pdf" compare="sim_size" />
240 </test> 263 </test>
241 <!-- Test defined point options options--> 264 <!-- Test defined point options options-->
242 <test expect_num_outputs="2"> 265 <test expect_num_outputs="2">
243 <param name="input1" value="mtcars.txt" ftype="tabular" /> 266 <param name="input1" value="mtcars.txt" ftype="tabular" />
267 <param name="xplot" value="8"/>
268 <param name="yplot" value="9"/>
244 <section name="adv"> 269 <section name="adv">
245 <conditional name="type_conditional"> 270 <conditional name="type_conditional">
246 <param name="type_options" value="points"/> 271 <param name="type_options" value="points"/>
247 <conditional name="points"> 272 <conditional name="points">
248 <param name="pointoptions" value="defined"/> 273 <param name="pointoptions" value="defined"/>