Mercurial > repos > iuc > ggplot2_point
comparison macros.xml @ 2:9a482995958c draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ggplot2 commit f9fb73a88ab8b52ce11c25a966d4fe99e67c9fbf
author | iuc |
---|---|
date | Mon, 11 Jun 2018 16:04:40 -0400 |
parents | 1bff6682e780 |
children | 52b8083a6159 |
comparison
equal
deleted
inserted
replaced
1:a78aa83f6625 | 2:9a482995958c |
---|---|
7 </requirements> | 7 </requirements> |
8 </xml> | 8 </xml> |
9 <token name="@VERSION@">2.2.1</token> | 9 <token name="@VERSION@">2.2.1</token> |
10 | 10 |
11 <token name="@R_INIT@"><![CDATA[ | 11 <token name="@R_INIT@"><![CDATA[ |
12 ## Setup R error handling to go to stderr | 12 ## Setup R error handling to go to stderr |
13 options(show.error.messages=F, error=function(){cat(geterrmessage(), file=stderr()); q("no",1,F)}) | 13 options(show.error.messages=F, error=function(){cat(geterrmessage(), file=stderr()); q("no",1,F)}) |
14 | 14 |
15 ## Unify locale settings | 15 ## Unify locale settings |
16 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") | 16 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") |
17 ]]></token> | 17 ]]></token> |
18 | 18 |
19 <token name="@TRANSFORM@"><![CDATA[ | 19 <token name="@TRANSFORM@"><![CDATA[ |
20 #if $transform == "log2" | 20 #if $adv.transform == "log2" |
21 input["value"] <- log2(input["value"]) | 21 input["value"] <- log2(input["value"]) |
22 #elif $transform == "log2plus1" | 22 #elif $adv.transform == "log2plus1" |
23 input["value"] <- log2(input["value"]+1) | 23 input["value"] <- log2(input["value"]+1) |
24 #elif $transform == "log10" | 24 #elif $adv.transform == "log10" |
25 input["value"] <- log10(input["value"]) | 25 input["value"] <- log10(input["value"]) |
26 #elif $transform == "log10plus1" | 26 #elif $adv.transform == "log10plus1" |
27 input["value"] <- log10(input["value"]+1) | 27 input["value"] <- log10(input["value"]+1) |
28 #end if | 28 #end if |
29 ]]></token> | 29 ]]></token> |
30 | 30 |
31 <token name="@XY_SCALING@"><![CDATA[ | |
32 #Choose between automatically scaled x and y axis or user defined | |
33 #if $adv.scaling.plot_scaling == "Automatic" | |
34 gg_scalex = NULL | |
35 gg_scaley = NULL | |
36 #else | |
37 gg_scalex = xlim($adv.scaling.xaxismin, $adv.scaling.xaxismax) | |
38 gg_scaley = ylim($adv.scaling.yaxismin, $adv.scaling.yaxismax) | |
39 cat("\n xaxismin: ", $adv.scaling.xaxismin) | |
40 cat("\n xaxismax: ", $adv.scaling.xaxismax) | |
41 cat("\n yaxismin: ", $adv.scaling.yaxismin) | |
42 cat("\n yaxismax: ", $adv.scaling.yaxismax) | |
43 #end if | |
44 ]]></token> | |
45 | |
46 <token name="@THEME@"><![CDATA[ | |
47 ## Choose theme for plot | |
48 #if $adv.theme == "bw" | |
49 gg_theme = theme_bw() | |
50 #else | |
51 gg_theme = NULL | |
52 #end if | |
53 ]]></token> | |
54 | |
55 <token name="@LEGEND@"><![CDATA[ | |
56 ## Show/hide legend | |
57 #if $adv.legend == "yes" | |
58 gg_legend = theme(legend.position="right") | |
59 #else | |
60 gg_legend = theme(legend.position="none") | |
61 cat("\n no legend") | |
62 #end if | |
63 ]]></token> | |
64 <token name="@SAVE_OUTPUT@"><![CDATA[ | |
65 ## output options need to be in out section | |
66 gg_width <- as.double('$out.width_output_dim') | |
67 gg_height <- as.double('$out.height_output_dim') | |
68 gg_unit <- '$out.unit_output_dim' | |
69 gg_dpi <- as.double('$out.dpi_output_dim') | |
70 gg_add_device <- '$out.additional_output_format' | |
71 output1 <- '$output1' | |
72 output2 <- '$output2' | |
73 | |
74 ## ggsave to png | |
75 ggsave(filename = output1, plot = plot_out, width = gg_width, height = gg_height, units = gg_unit, dpi = gg_dpi, device = "png") | |
76 if(gg_add_device != "none"){ | |
77 ggsave(filename = output2, plot = plot_out, width = gg_width, height = gg_height, units = gg_unit, dpi = gg_dpi, device = gg_add_device) | |
78 } | |
79 ]]></token> | |
80 <xml name="read_complex_input"> | |
81 <param name="input1" type="data" format="tabular" label="Select table"/> | |
82 <conditional name="inputdata"> | |
83 <param name="input_type" type="select" label="Select input dataset options" help="specific dataset input for reading"> | |
84 <option value="with_header" selected="true">Dataset with header</option> | |
85 <option value="with_rownames">Dataset with row names</option> | |
86 <option value="with_header_rownames">Dataset with header and row names</option> | |
87 <option value="no_header_rownames">Dataset without header or row names</option> | |
88 </param> | |
89 <when value="with_header"> | |
90 <param name="header" type="hidden" value="TRUE"/> | |
91 <param name="row_names_index" type="hidden" value="0"/> | |
92 <param name="sample_name_orientation" type="select" display="radio" multiple="false" label="Sample names orientation" help="Default horizontal: header names are interpreted as sample names"> | |
93 <option value="TRUE" selected="true">horizontal</option> | |
94 <option value="FALSE">vertial</option> | |
95 </param> | |
96 </when> | |
97 <when value="with_rownames"> | |
98 <param name="header" type="hidden" value="FALSE"/> | |
99 <param name="row_names_index" type="data_column" data_ref="input1" label="Select column, for row names" help="WARNING: please consider that using row names might shift the grouping columns"/> | |
100 <param name="sample_name_orientation" type="select" display="radio" label="Sample names orientation" help="default vertial: row names are interpreted as sample names"> | |
101 <option value="TRUE">horizontal</option> | |
102 <option value="FALSE" selected="true">vertial</option> | |
103 </param> | |
104 </when> | |
105 <when value="with_header_rownames"> | |
106 <param name="header" type="hidden" value="TRUE"/> | |
107 <param name="row_names_index" type="data_column" data_ref="input1" label="Select column, for row names" help="WARNING: please consider that using row names might shift the grouping columns"/> | |
108 <param name="sample_name_orientation" type="select" label="Sample names orientation" display="radio" multiple="false" help="deside whether header names or row names are interpreted as sample names"> | |
109 <option value="TRUE" selected="true">horizontal</option> | |
110 <option value="FALSE">vertial</option> | |
111 </param> | |
112 </when> | |
113 <when value="no_header_rownames"> | |
114 <param name="header" type="hidden" value="FALSE"/> | |
115 <param name="row_names_index" type="hidden" value="0"/> | |
116 <param name="sample_name_orientation" type="hidden" value="TRUE"/> | |
117 </when> | |
118 </conditional> | |
119 </xml> | |
31 <xml name="transform"> | 120 <xml name="transform"> |
32 <param name="transform" type="select" label="Advanced - log transformation"> | 121 <param name="transform" type="select" label="Data transformation"> |
33 <option value="none">Plot the data as it is</option> | 122 <option value="none">Plot the data as it is</option> |
34 <option value="log2">Log2(value) transform my data</option> | 123 <option value="log2">Log2(value) transform my data</option> |
35 <option value="log2plus1">Log2(value+1) transform my data</option> | 124 <option value="log2plus1">Log2(value+1) transform my data</option> |
36 <option value="log10">Log10(value) transform my data</option> | 125 <option value="log10">Log10(value) transform my data</option> |
37 <option value="log10plus1">Log10(value+1) transform my data</option> | 126 <option value="log10plus1">Log10(value+1) transform my data</option> |
38 </param> | 127 </param> |
39 </xml> | 128 </xml> |
40 | |
41 <token name="@XY_SCALING@"><![CDATA[ | |
42 #Choose between automatically scaled x and y axis or user defined | |
43 #if $scaling.plot_scaling == "Automatic" | |
44 gg_scalex = NULL | |
45 gg_scaley = NULL | |
46 #else | |
47 gg_scalex = xlim($scaling.xaxismin, $scaling.xaxismax) | |
48 gg_scaley = ylim($scaling.yaxismin, $scaling.yaxismax) | |
49 #end if | |
50 ]]></token> | |
51 | |
52 <xml name="xy_scaling"> | 129 <xml name="xy_scaling"> |
53 <conditional name="scaling"> | 130 <conditional name="scaling"> |
54 <param name="plot_scaling" type="select" label="Advanced - Axis scaling"> | 131 <param name="plot_scaling" type="select" label="Axis scaling"> |
55 <option value="Automatic" selected="True">Automatic axis scaling</option> | 132 <option value="Automatic" selected="true">Automatic axis scaling</option> |
56 <option value="Defined">User deined axis scales</option> | 133 <option value="Defined">User-defined axis scales</option> |
57 </param> | 134 </param> |
58 <when value="Automatic"> | 135 <when value="Automatic"> |
59 <!--Do nothing here --> | 136 <!--Do nothing here --> |
60 </when> | 137 </when> |
61 <when value="Defined"> | 138 <when value="Defined"> |
65 <param name="yaxismax" type="integer" value="3" label="maximal range of y-axis" /> | 142 <param name="yaxismax" type="integer" value="3" label="maximal range of y-axis" /> |
66 </when> | 143 </when> |
67 </conditional> | 144 </conditional> |
68 </xml> | 145 </xml> |
69 <xml name="title"> | 146 <xml name="title"> |
70 <param name="title" type="text" value="plot title" label="Title of plot" /> | 147 <param name="title" type="text" value="" label="Plot title"> |
148 <!--<sanitizer sanitize="false"/> --> | |
149 </param> | |
71 </xml> | 150 </xml> |
72 <xml name="xy_lab"> | 151 <xml name="xy_lab"> |
73 <param name="xlab" type="text" value="title of x-axis" label="Label for x-axis"/> | 152 <param name="xlab" type="text" value="title of x-axis" label="Label for x axis"> |
74 <param name="ylab" type="text" value="title of y-axis" label="Label for y-axis"/> | 153 <sanitizer sanitize="false"/> |
154 </param> | |
155 <param name="ylab" type="text" value="title of y-axis" label="Label for y axis"> | |
156 <sanitizer sanitize="false"/> | |
157 </param> | |
158 </xml> | |
159 <xml name="legend"> | |
160 <param name="legend" type="select" label="Legend options"> | |
161 <option value="yes">Include legend on plot</option> | |
162 <option value="no">Hide legend</option> | |
163 </param> | |
164 </xml> | |
165 <xml name="theme"> | |
166 <param name="theme" type="select" label="Backgound theme for plot"> | |
167 <option value="bw">Black and white</option> | |
168 <option value="Default">Default (grey)</option> | |
169 </param> | |
75 </xml> | 170 </xml> |
76 <xml name="dimensions"> | 171 <xml name="dimensions"> |
77 <param name="with_output_dim" type="float" value="7" label="width of output" help="in inches" /> | 172 <param name="unit_output_dim" type="select" label="Unit of output dimensions" help="default inches"> |
78 <param name="height_output_dim" type="float" value="7" label="height of output" help="in inches" /> | 173 <option value="in" selected="true">Inches (in)</option> |
174 <option value="cm">Centimeters (cm)</option> | |
175 <option value="mm">Millimeters (mm)</option> | |
176 </param> | |
177 <param name="width_output_dim" type="float" value="7" label="width of output"/> | |
178 <param name="height_output_dim" type="float" value="7" label="height of output"/> | |
179 <param name="dpi_output_dim" type="float" value="300" label="dpi of output" help="Plot resolution. Applies only to raster output types."/> | |
180 <param name="additional_output_format" type="select" label="Additional output format" help="PNG is always selected as output format"> | |
181 <option value="none" selected="true">only PNG</option> | |
182 <option value="pdf">PDF</option> | |
183 <option value="svg">SVG</option> | |
184 <option value="eps">EPS</option> | |
185 <option value="ps">PS</option> | |
186 <option value="tex">TEX (pictex)</option> | |
187 <option value="jpeg">JPEG</option> | |
188 <option value="tiff">TIFF</option> | |
189 <option value="bmp">BMP</option> | |
190 </param> | |
79 </xml> | 191 </xml> |
80 <xml name="citations"> | 192 <xml name="citations"> |
81 <citations> | 193 <citations> |
82 <citation type="bibtex">@Book{ | 194 <citation type="bibtex">@book{wickham2009ggplot2, |
83 author = {Hadley Wickham}, | 195 author = {Hadley Wickham}, |
84 title = {ggplot2: Elegant Graphics for Data Analysis}, | 196 title = {ggplot2: Elegant Graphics for Data Analysis}, |
85 publisher = {Springer-Verlag New York}, | 197 publisher = {Springer-Verlag New York}, |
86 year = {2009}, | 198 year = {2009}, |
87 isbn = {978-0-387-98140-6}, | 199 isbn = {978-0-387-98140-6}, |
88 url = {http://ggplot2.org} | 200 url = {http://ggplot2.org}, |
89 } | 201 } |
90 </citation> | 202 </citation> |
203 <yield /> | |
91 </citations> | 204 </citations> |
92 </xml> | 205 </xml> |
93 | 206 <xml name="axis_customization" token_label="Axis title options"> |
94 <xml name="axis_customization" token_label="Advanced - axis title options"> | |
95 <param name="axis_customization" type="select" label="@LABEL@"> | 207 <param name="axis_customization" type="select" label="@LABEL@"> |
96 <option value="default" selected="True">Default</option> | 208 <option value="default" selected="true">Default</option> |
97 <option value="defined">User defined label options</option> | 209 <option value="defined">User defined label options</option> |
98 </param> | 210 </param> |
99 <when value="default"> | 211 <when value="default"> |
100 <!--Do nothing here --> | 212 <!--Do nothing here --> |
101 </when> | 213 </when> |
111 <option value="green">Green</option> | 223 <option value="green">Green</option> |
112 <option value="purple">Purple</option> | 224 <option value="purple">Purple</option> |
113 <option value="magenta">Magenta</option> | 225 <option value="magenta">Magenta</option> |
114 <option value="cyan">Cyan</option> | 226 <option value="cyan">Cyan</option> |
115 <option value="grey">Grey</option> | 227 <option value="grey">Grey</option> |
116 <option value="gold">Gold</option> | 228 <option value="gold">Gold</option> |
117 </param> | 229 </param> |
118 <param name="face" type="select" label="Font effect of axis label"> | 230 <param name="face" type="select" label="Font effect of axis label"> |
119 <option value="plain">Normal (default)</option> | 231 <option value="plain">Normal (default)</option> |
120 <option value="bold">Bold</option> | 232 <option value="bold">Bold</option> |
121 <option value="italic">Italic</option> | 233 <option value="italic">Italic</option> |
122 </param> | 234 </param> |
123 </when> | 235 </when> |
124 </xml> | 236 </xml> |
125 | |
126 <xml name="colors"> | 237 <xml name="colors"> |
127 <param name="colors" type="select" label="Color schemes to differentiate your groups" > | 238 <param name="colors" type="select" label="Color schemes to differentiate your groups" > |
128 <option value="Default">Default color scheme</option> | 239 <option value="Default">Default color scheme</option> |
129 <option value="YlOrRd">Yellow to orange to red (discrete, max=9 colors)</option> | 240 <option value="YlOrRd">Yellow to orange to red (discrete, max=9 colors)</option> |
130 <option value="YlOrBr">Yellow to orange to brown (discrete, max=9 colors)</option> | 241 <option value="YlOrBr">Yellow to orange to brown (discrete, max=9 colors)</option> |
157 <option value="RdYlBu">Red to yellow to blue (discrete, max=11 colors)</option> | 268 <option value="RdYlBu">Red to yellow to blue (discrete, max=11 colors)</option> |
158 <option value="RdGy">Red to grey (discrete, max=11 colors)</option> | 269 <option value="RdGy">Red to grey (discrete, max=11 colors)</option> |
159 <option value="RdBu">Red to blue (discrete, max=11 colors)</option> | 270 <option value="RdBu">Red to blue (discrete, max=11 colors)</option> |
160 <option value="PuOr">Purple to orange (discrete, max=11 colors)</option> | 271 <option value="PuOr">Purple to orange (discrete, max=11 colors)</option> |
161 <option value="PRGn">Purple to green (discrete, max=11 colors)</option> | 272 <option value="PRGn">Purple to green (discrete, max=11 colors)</option> |
162 <option value="BrBG">Brown to teal (discrete, max=11 colors)</option> | 273 <option value="BrBG">Brown to teal (discrete, max=11 colors)</option> |
163 </param> | 274 </param> |
164 </xml> | 275 </xml> |
165 | 276 <xml name="additional_output"> |
277 <data name="output1" format="png" label="${tool.name} on ${on_string}: png"/> | |
278 <data format="pdf" name="output2" label="${tool.name} on ${on_string}: ${out.additional_output_format}"> | |
279 <change_format> | |
280 <when input="out.additional_output_format" value="svg" format="svg" /> | |
281 <when input="out.additional_output_format" value="eps" format="eps" /> | |
282 <when input="out.additional_output_format" value="ps" format="ps" /> | |
283 <when input="out.additional_output_format" value="tex" format="txt" /> | |
284 <when input="out.additional_output_format" value="jpeg" format="jpg" /> | |
285 <when input="out.additional_output_format" value="tiff" format="tiff" /> | |
286 <when input="out.additional_output_format" value="bmp" format="bmp" /> | |
287 </change_format> | |
288 <filter>out['additional_output_format'] != "none"</filter> | |
289 </data> | |
290 </xml> | |
166 </macros> | 291 </macros> |