Mercurial > repos > iuc > ggplot2_point
comparison ggplot_point.xml @ 9:1acf88921176 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ggplot2 commit 4b44f8f834de15fd34e2fdc5e4aed282069f73af"
| author | iuc |
|---|---|
| date | Tue, 23 Nov 2021 07:58:14 +0000 |
| parents | e3a675da7fd0 |
| children | 299307abd804 |
comparison
equal
deleted
inserted
replaced
| 8:e3a675da7fd0 | 9:1acf88921176 |
|---|---|
| 1 <tool id="ggplot2_point" name="Scatterplot with ggplot2" version="@VERSION@+galaxy2" profile="18.01"> | 1 <tool id="ggplot2_point" name="Scatterplot with ggplot2" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01"> |
| 2 <expand macro="bio_tools"/> | 2 <expand macro="bio_tools"/> |
| 3 <macros> | 3 <macros> |
| 4 <import>macros.xml</import> | 4 <import>macros.xml</import> |
| 5 </macros> | 5 </macros> |
| 6 <expand macro="requirements"> | 6 <expand macro="requirements"> |
| 7 <requirement type="package" version="1.2.1">r-svglite</requirement> | 7 <requirement type="package" version="2.0.0">r-svglite</requirement> |
| 8 </expand> | 8 </expand> |
| 9 <command detect_errors="exit_code"><![CDATA[ | 9 <command detect_errors="exit_code"><![CDATA[ |
| 10 cat '$script' && | 10 cat '$script' && |
| 11 Rscript '$script' | 11 Rscript '$script' |
| 12 ]]></command> | 12 ]]></command> |
| 32 ## choosing whether to plot data as multiple groups on one plot(factoring) OR multiple groups on different plots | 32 ## choosing whether to plot data as multiple groups on one plot(factoring) OR multiple groups on different plots |
| 33 #if $adv.factor.factoring == "Multiple" | 33 #if $adv.factor.factoring == "Multiple" |
| 34 gg_facet = facet_wrap( ~ factor) | 34 gg_facet = facet_wrap( ~ factor) |
| 35 gg_factor = NULL | 35 gg_factor = NULL |
| 36 color_scale = NULL | 36 color_scale = NULL |
| 37 #if $adv.points.pointoptions == "default" | 37 #if $adv.type_conditional.points.pointoptions == "default" |
| 38 gg_point = geom_point(size=1, alpha=1, gg_factor) | 38 gg_point = geom_point(size=1, alpha=1, gg_factor) |
| 39 gg_line = geom_line(size=1, alpha=1, gg_factor) | 39 gg_line = geom_line(size=1, alpha=1, gg_factor) |
| 40 #else | 40 #else |
| 41 gg_point = geom_point(size=$adv.points.size, alpha=$adv.points.alpha, colour='$adv.points.pointcolor') | 41 gg_point = geom_point(size=$adv.type_conditional.points.size, alpha=$adv.type_conditional.points.alpha, colour='$adv.type_conditional.points.pointcolor') |
| 42 gg_line = geom_line(size=$adv.points.size, alpha=$adv.points.alpha, colour='$adv.points.pointcolor') | 42 gg_line = geom_line(size=$adv.type_conditional.points.size, alpha=$adv.type_conditional.points.alpha, colour='$adv.type_conditional.points.pointcolor') |
| 43 #end if | 43 #end if |
| 44 | 44 |
| 45 names(input)[$adv.factor.factorcol] <- "factor" | 45 names(input)[$adv.factor.factorcol] <- "factor" |
| 46 | 46 |
| 47 #elif $adv.factor.factoring == "Single" | 47 #elif $adv.factor.factoring == "Single" |
| 48 gg_facet = NULL | 48 gg_facet = NULL |
| 49 gg_factor = aes(colour=factor(factor)) | 49 gg_factor = aes(colour=factor(factor)) |
| 50 | 50 |
| 51 #if $adv.points.pointoptions == "default" | 51 #if $adv.type_conditional.points.pointoptions == "default" |
| 52 gg_point = geom_point(size=1, alpha=1, gg_factor) | 52 gg_point = geom_point(size=1, alpha=1, gg_factor) |
| 53 gg_line = geom_line(size=1, alpha=1, gg_factor) | 53 gg_line = geom_line(size=1, alpha=1, gg_factor) |
| 54 #else | 54 #else |
| 55 gg_point = geom_point(size=$adv.points.size, alpha=$adv.points.alpha, gg_factor) | 55 gg_point = geom_point(size=$adv.type_conditional.points.size, alpha=$adv.type_conditional.points.alpha, gg_factor) |
| 56 gg_line = geom_line(size=$adv.points.size, alpha=$adv.points.alpha, gg_factor) | 56 gg_line = geom_line(size=$adv.type_conditional.points.size, alpha=$adv.type_conditional.points.alpha, gg_factor) |
| 57 #end if | 57 #end if |
| 58 | 58 |
| 59 #if $adv.factor.colororder == 1 | 59 #if $adv.factor.colororder == 1 |
| 60 color_scale = scale_colour_hue(direction='$adv.factor.colororder') | 60 color_scale = scale_colour_hue(direction='$adv.factor.colororder') |
| 61 #else | 61 #else |
| 66 #else | 66 #else |
| 67 gg_facet = NULL | 67 gg_facet = NULL |
| 68 gg_factor = NULL | 68 gg_factor = NULL |
| 69 color_scale = NULL | 69 color_scale = NULL |
| 70 | 70 |
| 71 #if $adv.points.pointoptions == "default" | 71 #if $adv.type_conditional.points.pointoptions == "default" |
| 72 gg_point = geom_point(size=1, alpha=1, gg_factor) | 72 gg_point = geom_point(size=1, alpha=1, gg_factor) |
| 73 gg_line = geom_line(size=1, alpha=1, gg_factor) | 73 gg_line = geom_line(size=1, alpha=1, gg_factor) |
| 74 #else | 74 #else |
| 75 gg_point = geom_point(size=$adv.points.size, alpha=$adv.points.alpha, colour='$adv.points.pointcolor') | 75 gg_point = geom_point(size=$adv.type_conditional.points.size, alpha=$adv.type_conditional.points.alpha, colour='$adv.type_conditional.points.pointcolor') |
| 76 gg_line = geom_line(size=$adv.points.size, alpha=$adv.points.alpha, colour='$adv.points.pointcolor') | 76 gg_line = geom_line(size=$adv.type_conditional.points.size, alpha=$adv.type_conditional.points.alpha, colour='$adv.type_conditional.points.pointcolor') |
| 77 #end if | 77 #end if |
| 78 #end if | 78 #end if |
| 79 | 79 |
| 80 @TRANSFORM@ | 80 @TRANSFORM@ |
| 81 | 81 |
| 82 ##axis label custization | 82 ##axis label custization |
| 83 #if $adv.axis_title_customization.axis_customization == "default" | 83 #if $adv.axis_title_customization.axis_customization == "default" |
| 84 gg_axistitle = theme(axis.title = element_text(color = NULL, size = NULL, face = NULL)) | 84 gg_axistitle = theme(axis.title = element_text(color = NULL, size = NULL, face = NULL)) |
| 85 #else | 85 #else |
| 86 gg_axistitle = theme(axis.title = element_text(color = '$adv.color', size = $adv.size, face = '$adv.face')) | 86 gg_axistitle = theme(axis.title = element_text(color = '$adv.axis_text_customization.color', size = $adv.axis_text_customization.size, face = '$adv.axis_text_customization.face')) |
| 87 #end if | 87 #end if |
| 88 | 88 |
| 89 ##axis text(tick) custization | 89 ##axis text(tick) custization |
| 90 #if $adv.axis_text_customization.axis_customization == "default" | 90 #if $adv.axis_text_customization.axis_customization == "default" |
| 91 gg_axistext = theme(axis.text = element_text(color = NULL, size = NULL, face = NULL)) | 91 gg_axistext = theme(axis.text = element_text(color = NULL, size = NULL, face = NULL)) |
| 92 #else | 92 #else |
| 93 gg_axistext = theme(axis.text = element_text(color = '$adv.color', size = $adv.size, face = '$adv.face')) | 93 gg_axistext = theme(axis.text = element_text(color = '$adv.axis_text_customization.color', size = $adv.axis_text_customization.size, face = '$adv.axis_text_customization.face')) |
| 94 #end if | 94 #end if |
| 95 | 95 |
| 96 ##plot title custimization | 96 ##plot title custimization |
| 97 #if $adv.plot_title_customization.axis_customization == "default" | 97 #if $adv.plot_title_customization.axis_customization == "default" |
| 98 gg_plottitle = theme(plot.title = element_text(color = NULL, size = NULL, face = NULL)) | 98 gg_plottitle = theme(plot.title = element_text(color = NULL, size = NULL, face = NULL)) |
| 99 #else | 99 #else |
| 100 gg_plottitle = theme(plot.title = element_text(color='$adv.color', size=$adv.size, face='$adv.face')) | 100 gg_plottitle = theme(plot.title = element_text(color='$adv.axis_text_customization.color', size=$adv.axis_text_customization.size, face='$adv.axis_text_customization.face')) |
| 101 #end if | 101 #end if |
| 102 | 102 |
| 103 ## grid line customization | 103 ## grid line customization |
| 104 #if $adv.gridlinecust == "default" | 104 #if $adv.gridlinecust == "default" |
| 105 gg_gridline = NULL | 105 gg_gridline = NULL |
| 110 #elif $adv.gridlinecust == "hideboth" | 110 #elif $adv.gridlinecust == "hideboth" |
| 111 gg_gridline = theme(panel.grid.minor = element_blank(), panel.grid.major = element_blank()) | 111 gg_gridline = theme(panel.grid.minor = element_blank(), panel.grid.major = element_blank()) |
| 112 #end if | 112 #end if |
| 113 | 113 |
| 114 ## choose between graph types (points/lines/both) | 114 ## choose between graph types (points/lines/both) |
| 115 #if $adv.type == "points" | 115 #if $adv.type_conditional.type_options == "points" |
| 116 gg_line = NULL | 116 gg_line = NULL |
| 117 #elif $adv.type == "lines" | 117 #elif $adv.type_conditional.type_options == "lines" |
| 118 gg_point = NULL | 118 gg_point = NULL |
| 119 #end if | 119 #end if |
| 120 | 120 |
| 121 #this is the actual ggplot command to make the final plot(s) | 121 #this is the actual ggplot command to make the final plot(s) |
| 122 plot_out <- ggplot(input, aes(xcol, ycol)) + gg_point + gg_line + gg_facet + | 122 plot_out <- ggplot(input, aes(xcol, ycol)) + gg_point + gg_line + gg_facet + |
| 131 <param name="xplot" type="integer" value="8" label="Column to plot on x-axis" /> | 131 <param name="xplot" type="integer" value="8" label="Column to plot on x-axis" /> |
| 132 <param name="yplot" type="integer" value="9" label="Column to plot on y-axis" /> | 132 <param name="yplot" type="integer" value="9" label="Column to plot on y-axis" /> |
| 133 | 133 |
| 134 <expand macro="title" /> | 134 <expand macro="title" /> |
| 135 <expand macro="xy_lab" /> | 135 <expand macro="xy_lab" /> |
| 136 <section name="adv" title="Advanced Options" expanded="false"> | 136 <section name="adv" title="Advanced options"> |
| 137 <param name="type" type="select" label="Type of plot" > | 137 <conditional name="type_conditional"> |
| 138 <option value="points">Points only (default)</option> | 138 <param name="type_options" type="select" label="Type of plot" > |
| 139 <option value="lines">Lines only </option> | 139 <option value="points">Points only (default)</option> |
| 140 <option value="pointslines">Points and Lines</option> | 140 <option value="lines">Lines only </option> |
| 141 </param> | 141 <option value="pointslines">Points and Lines</option> |
| 142 <conditional name="points"> | |
| 143 <param name="pointoptions" type="select" label="Data point options"> | |
| 144 <option value="default" selected="true">Default</option> | |
| 145 <option value="defined">User defined point options</option> | |
| 146 </param> | 142 </param> |
| 147 <when value="default"> | 143 <when value ="points"> |
| 148 <!--Do nothing here --> | 144 <expand macro="points_options"/> |
| 149 </when> | 145 </when> |
| 150 <when value="defined"> | 146 <when value="pointslines"> |
| 151 <param name="size" type="float" value="1" label="relative size of points" /> | 147 <expand macro="points_options"/> |
| 152 <param name="alpha" type="float" value="1" label="Transparency of points (On a scale of 0-1; 0=transparent, 1=default)" /> | 148 </when> |
| 153 <param name="pointcolor" type="select" label="Color of data points" > | 149 <when value="lines"/> |
| 154 <option value="black">Black (default)</option> | |
| 155 <option value="red">Red</option> | |
| 156 <option value="white">White</option> | |
| 157 <option value="blue">Blue</option> | |
| 158 <option value="orange">Orange</option> | |
| 159 <option value="yellow">Yellow</option> | |
| 160 <option value="green">Green</option> | |
| 161 <option value="purple">Purple</option> | |
| 162 <option value="magenta">Magenta</option> | |
| 163 <option value="cyan">Cyan</option> | |
| 164 <option value="grey">Grey</option> | |
| 165 <option value="gold">Gold</option> | |
| 166 </param> | |
| 167 </when> | |
| 168 </conditional> | 150 </conditional> |
| 169 <conditional name="factor"> | 151 <conditional name="factor"> |
| 170 <param name="factoring" type="select" label="Plotting multiple groups" > | 152 <param name="factoring" type="select" label="Plotting multiple groups" > |
| 171 <option value="Default" selected="true">No thanks - just plot the data as one group</option> | 153 <option value="Default" selected="true">No thanks - just plot the data as one group</option> |
| 172 <option value="Single">Plot multiple groups of data on one plot</option> | 154 <option value="Single">Plot multiple groups of data on one plot</option> |
| 195 </conditional> | 177 </conditional> |
| 196 <conditional name="plot_title_customization"> | 178 <conditional name="plot_title_customization"> |
| 197 <expand macro="axis_customization" label="Plot title options" /> | 179 <expand macro="axis_customization" label="Plot title options" /> |
| 198 </conditional> | 180 </conditional> |
| 199 <param name="gridlinecust" type="select" label="Grid lines"> | 181 <param name="gridlinecust" type="select" label="Grid lines"> |
| 200 <option value="default">Default grid lines</option> | 182 <option value="default">Default grid lines</option> |
| 201 <option value="hidemajor">Hide major grid lines</option> | 183 <option value="hidemajor">Hide major grid lines</option> |
| 202 <option value="hideminor">Hide minor grid lines</option> | 184 <option value="hideminor">Hide minor grid lines</option> |
| 203 <option value="hideboth">Hide major and minor grid lines</option> | 185 <option value="hideboth">Hide major and minor grid lines</option> |
| 204 </param> | 186 </param> |
| 205 <expand macro="transform" /> | 187 <expand macro="transform" /> |
| 206 <expand macro="xy_scaling" /> | 188 <expand macro="xy_scaling" /> |
| 207 <expand macro="theme" /> | 189 <expand macro="theme" /> |
| 208 <expand macro="legend" /> | 190 <expand macro="legend" /> |
| 218 <test> | 200 <test> |
| 219 <param name="input1" value="mtcars.txt" ftype="tabular" /> | 201 <param name="input1" value="mtcars.txt" ftype="tabular" /> |
| 220 <param name="additional_output_format" value="pdf" /> | 202 <param name="additional_output_format" value="pdf" /> |
| 221 <output name="output2" file="ggplot_point_result1.pdf" compare="sim_size" /> | 203 <output name="output2" file="ggplot_point_result1.pdf" compare="sim_size" /> |
| 222 </test> | 204 </test> |
| 205 <!-- Test text options--> | |
| 206 <test> | |
| 207 <param name="input1" value="mtcars.txt" ftype="tabular" /> | |
| 208 <section name="adv"> | |
| 209 <conditional name="type_conditional"> | |
| 210 <param name="type_options" value="points"/> | |
| 211 <conditional name="points"> | |
| 212 <param name="pointoptions" value="default"/> | |
| 213 </conditional> | |
| 214 </conditional> | |
| 215 <conditional name="axis_text_customization"> | |
| 216 <param name="axis_customization" value="defined"/> | |
| 217 <param name="color" value="red"/> | |
| 218 </conditional> | |
| 219 </section> | |
| 220 <param name="additional_output_format" value="pdf" /> | |
| 221 <output name="output2" file="ggplot_point_result2.pdf" compare="sim_size" /> | |
| 222 </test> | |
| 223 </tests> | 223 </tests> |
| 224 <help><![CDATA[ | 224 <help><![CDATA[ |
| 225 This tool will generate a scatterplot representing data from two groups/conditions. | 225 This tool will generate a scatterplot representing data from two groups/conditions. |
| 226 | 226 |
| 227 The input data should be in tabular format and the user can determine which groups (columns) to plot. | 227 The input data should be in tabular format and the user can determine which groups (columns) to plot. |
| 228 | 228 |
| 229 Multiple groups can be plotted on the same or multiple plots by providing a column with a group identifier under "Advanced - plotting multiple groups". | 229 Multiple groups can be plotted on the same or multiple plots by providing a column with a group identifier under "advanced - plotting multiple groups". |
| 230 | 230 |
| 231 Feel free to explore the (many) advanced options to customize your plot. Galaxy makes this type optimization easy for the user! | 231 Feel free to explore the (many) advanced options to customize your plot. Galaxy makes this type optimization easy for the user! |
| 232 | 232 |
| 233 The ouput is a pdf file with your scatterplot. The dimensions of this file can be modified under "Advanced - output dimensions" | 233 The ouput is a pdf file with your scatterplot. The dimensions of this file can be modified under "advanced - output dimensions" |
| 234 ]]></help> | 234 ]]></help> |
| 235 <expand macro="citations"/> | 235 <expand macro="citations"/> |
| 236 </tool> | 236 </tool> |
