Mercurial > repos > iuc > ggplot2_point
changeset 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 |
files | ggplot_point.xml macros.xml test-data/ggplot_heatmap_result1.pdf test-data/ggplot_histogram_result1.pdf test-data/ggplot_pca_result1.pdf test-data/ggplot_point_result1.pdf test-data/ggplot_point_result2.pdf |
diffstat | 7 files changed, 93 insertions(+), 65 deletions(-) [+] |
line wrap: on
line diff
--- a/ggplot_point.xml Tue Oct 26 15:12:15 2021 +0000 +++ b/ggplot_point.xml Tue Nov 23 07:58:14 2021 +0000 @@ -1,10 +1,10 @@ -<tool id="ggplot2_point" name="Scatterplot with ggplot2" version="@VERSION@+galaxy2" profile="18.01"> +<tool id="ggplot2_point" name="Scatterplot with ggplot2" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01"> <expand macro="bio_tools"/> <macros> <import>macros.xml</import> </macros> <expand macro="requirements"> - <requirement type="package" version="1.2.1">r-svglite</requirement> + <requirement type="package" version="2.0.0">r-svglite</requirement> </expand> <command detect_errors="exit_code"><![CDATA[ cat '$script' && @@ -34,12 +34,12 @@ gg_facet = facet_wrap( ~ factor) gg_factor = NULL color_scale = NULL - #if $adv.points.pointoptions == "default" + #if $adv.type_conditional.points.pointoptions == "default" gg_point = geom_point(size=1, alpha=1, gg_factor) gg_line = geom_line(size=1, alpha=1, gg_factor) #else - gg_point = geom_point(size=$adv.points.size, alpha=$adv.points.alpha, colour='$adv.points.pointcolor') - gg_line = geom_line(size=$adv.points.size, alpha=$adv.points.alpha, colour='$adv.points.pointcolor') + gg_point = geom_point(size=$adv.type_conditional.points.size, alpha=$adv.type_conditional.points.alpha, colour='$adv.type_conditional.points.pointcolor') + gg_line = geom_line(size=$adv.type_conditional.points.size, alpha=$adv.type_conditional.points.alpha, colour='$adv.type_conditional.points.pointcolor') #end if names(input)[$adv.factor.factorcol] <- "factor" @@ -48,12 +48,12 @@ gg_facet = NULL gg_factor = aes(colour=factor(factor)) - #if $adv.points.pointoptions == "default" + #if $adv.type_conditional.points.pointoptions == "default" gg_point = geom_point(size=1, alpha=1, gg_factor) gg_line = geom_line(size=1, alpha=1, gg_factor) #else - gg_point = geom_point(size=$adv.points.size, alpha=$adv.points.alpha, gg_factor) - gg_line = geom_line(size=$adv.points.size, alpha=$adv.points.alpha, gg_factor) + gg_point = geom_point(size=$adv.type_conditional.points.size, alpha=$adv.type_conditional.points.alpha, gg_factor) + gg_line = geom_line(size=$adv.type_conditional.points.size, alpha=$adv.type_conditional.points.alpha, gg_factor) #end if #if $adv.factor.colororder == 1 @@ -68,12 +68,12 @@ gg_factor = NULL color_scale = NULL - #if $adv.points.pointoptions == "default" + #if $adv.type_conditional.points.pointoptions == "default" gg_point = geom_point(size=1, alpha=1, gg_factor) gg_line = geom_line(size=1, alpha=1, gg_factor) #else - gg_point = geom_point(size=$adv.points.size, alpha=$adv.points.alpha, colour='$adv.points.pointcolor') - gg_line = geom_line(size=$adv.points.size, alpha=$adv.points.alpha, colour='$adv.points.pointcolor') + gg_point = geom_point(size=$adv.type_conditional.points.size, alpha=$adv.type_conditional.points.alpha, colour='$adv.type_conditional.points.pointcolor') + gg_line = geom_line(size=$adv.type_conditional.points.size, alpha=$adv.type_conditional.points.alpha, colour='$adv.type_conditional.points.pointcolor') #end if #end if @@ -83,21 +83,21 @@ #if $adv.axis_title_customization.axis_customization == "default" gg_axistitle = theme(axis.title = element_text(color = NULL, size = NULL, face = NULL)) #else - gg_axistitle = theme(axis.title = element_text(color = '$adv.color', size = $adv.size, face = '$adv.face')) + 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')) #end if ##axis text(tick) custization #if $adv.axis_text_customization.axis_customization == "default" gg_axistext = theme(axis.text = element_text(color = NULL, size = NULL, face = NULL)) #else - gg_axistext = theme(axis.text = element_text(color = '$adv.color', size = $adv.size, face = '$adv.face')) + 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')) #end if ##plot title custimization #if $adv.plot_title_customization.axis_customization == "default" gg_plottitle = theme(plot.title = element_text(color = NULL, size = NULL, face = NULL)) #else - gg_plottitle = theme(plot.title = element_text(color='$adv.color', size=$adv.size, face='$adv.face')) + 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')) #end if ## grid line customization @@ -112,9 +112,9 @@ #end if ## choose between graph types (points/lines/both) -#if $adv.type == "points" +#if $adv.type_conditional.type_options == "points" gg_line = NULL -#elif $adv.type == "lines" +#elif $adv.type_conditional.type_options == "lines" gg_point = NULL #end if @@ -133,38 +133,20 @@ <expand macro="title" /> <expand macro="xy_lab" /> - <section name="adv" title="Advanced Options" expanded="false"> - <param name="type" type="select" label="Type of plot" > - <option value="points">Points only (default)</option> - <option value="lines">Lines only </option> - <option value="pointslines">Points and Lines</option> - </param> - <conditional name="points"> - <param name="pointoptions" type="select" label="Data point options"> - <option value="default" selected="true">Default</option> - <option value="defined">User defined point options</option> + <section name="adv" title="Advanced options"> + <conditional name="type_conditional"> + <param name="type_options" type="select" label="Type of plot" > + <option value="points">Points only (default)</option> + <option value="lines">Lines only </option> + <option value="pointslines">Points and Lines</option> </param> - <when value="default"> - <!--Do nothing here --> + <when value ="points"> + <expand macro="points_options"/> </when> - <when value="defined"> - <param name="size" type="float" value="1" label="relative size of points" /> - <param name="alpha" type="float" value="1" label="Transparency of points (On a scale of 0-1; 0=transparent, 1=default)" /> - <param name="pointcolor" type="select" label="Color of data points" > - <option value="black">Black (default)</option> - <option value="red">Red</option> - <option value="white">White</option> - <option value="blue">Blue</option> - <option value="orange">Orange</option> - <option value="yellow">Yellow</option> - <option value="green">Green</option> - <option value="purple">Purple</option> - <option value="magenta">Magenta</option> - <option value="cyan">Cyan</option> - <option value="grey">Grey</option> - <option value="gold">Gold</option> - </param> + <when value="pointslines"> + <expand macro="points_options"/> </when> + <when value="lines"/> </conditional> <conditional name="factor"> <param name="factoring" type="select" label="Plotting multiple groups" > @@ -197,10 +179,10 @@ <expand macro="axis_customization" label="Plot title options" /> </conditional> <param name="gridlinecust" type="select" label="Grid lines"> - <option value="default">Default grid lines</option> - <option value="hidemajor">Hide major grid lines</option> - <option value="hideminor">Hide minor grid lines</option> - <option value="hideboth">Hide major and minor grid lines</option> + <option value="default">Default grid lines</option> + <option value="hidemajor">Hide major grid lines</option> + <option value="hideminor">Hide minor grid lines</option> + <option value="hideboth">Hide major and minor grid lines</option> </param> <expand macro="transform" /> <expand macro="xy_scaling" /> @@ -220,17 +202,35 @@ <param name="additional_output_format" value="pdf" /> <output name="output2" file="ggplot_point_result1.pdf" compare="sim_size" /> </test> + <!-- Test text options--> + <test> + <param name="input1" value="mtcars.txt" ftype="tabular" /> + <section name="adv"> + <conditional name="type_conditional"> + <param name="type_options" value="points"/> + <conditional name="points"> + <param name="pointoptions" value="default"/> + </conditional> + </conditional> + <conditional name="axis_text_customization"> + <param name="axis_customization" value="defined"/> + <param name="color" value="red"/> + </conditional> + </section> + <param name="additional_output_format" value="pdf" /> + <output name="output2" file="ggplot_point_result2.pdf" compare="sim_size" /> + </test> </tests> <help><![CDATA[ This tool will generate a scatterplot representing data from two groups/conditions. The input data should be in tabular format and the user can determine which groups (columns) to plot. -Multiple groups can be plotted on the same or multiple plots by providing a column with a group identifier under "Advanced - plotting multiple groups". +Multiple groups can be plotted on the same or multiple plots by providing a column with a group identifier under "advanced - plotting multiple groups". Feel free to explore the (many) advanced options to customize your plot. Galaxy makes this type optimization easy for the user! -The ouput is a pdf file with your scatterplot. The dimensions of this file can be modified under "Advanced - output dimensions" +The ouput is a pdf file with your scatterplot. The dimensions of this file can be modified under "advanced - output dimensions" ]]></help> <expand macro="citations"/> </tool>
--- a/macros.xml Tue Oct 26 15:12:15 2021 +0000 +++ b/macros.xml Tue Nov 23 07:58:14 2021 +0000 @@ -2,16 +2,19 @@ <macros> <xml name="requirements"> <requirements> - <requirement type="package" version="@VERSION@">r-ggplot2</requirement> + <requirement type="package" version="4.1.1">r-base</requirement> + <requirement type="package" version="@TOOL_VERSION@">r-ggplot2</requirement> <yield /> </requirements> </xml> <xml name="bio_tools"> <xrefs> - <xref type="bio.tools">gemini</xref> + <xref type="bio.tools">ggplot2</xref> </xrefs> </xml> - <token name="@VERSION@">2.2.1</token> + <token name="@TOOL_VERSION@">3.3.5</token> + <token name="@VERSION_SUFFIX@">0</token> + <token name="@R_INIT@"><![CDATA[ ## Setup R error handling to go to stderr @@ -137,9 +140,7 @@ <option value="Automatic" selected="true">Automatic axis scaling</option> <option value="Defined">User-defined axis scales</option> </param> - <when value="Automatic"> - <!--Do nothing here --> - </when> + <when value="Automatic"/> <when value="Defined"> <param name="xaxismin" type="float" value="0" label="minimal range of x-axis" /> <param name="xaxismax" type="float" value="3" label="maximal range of x-axis" /> @@ -154,10 +155,10 @@ </param> </xml> <xml name="xy_lab"> - <param name="xlab" type="text" value="title of x-axis" label="Label for x axis"> + <param name="xlab" type="text" value="Title of x-axis" label="Label for x axis"> <sanitizer sanitize="false"/> </param> - <param name="ylab" type="text" value="title of y-axis" label="Label for y axis"> + <param name="ylab" type="text" value="Title of y-axis" label="Label for y axis"> <sanitizer sanitize="false"/> </param> </xml> @@ -174,7 +175,7 @@ </param> </xml> <xml name="dimensions"> - <param name="unit_output_dim" type="select" label="Unit of output dimensions" help="default inches"> + <param name="unit_output_dim" type="select" label="Unit of output dimensions" help="Default: inches."> <option value="in" selected="true">Inches (in)</option> <option value="cm">Centimeters (cm)</option> <option value="mm">Millimeters (mm)</option> @@ -182,8 +183,8 @@ <param name="width_output_dim" type="float" value="7" label="width of output"/> <param name="height_output_dim" type="float" value="7" label="height of output"/> <param name="dpi_output_dim" type="float" value="300" label="dpi of output" help="Plot resolution. Applies only to raster output types."/> - <param name="additional_output_format" type="select" label="Additional output format" help="PNG is always selected as output format"> - <option value="none" selected="true">only PNG</option> + <param name="additional_output_format" type="select" label="Additional output format" help="PNG is always selected as output format."> + <option value="none" selected="true">Only PNG</option> <option value="pdf">PDF</option> <option value="svg">SVG</option> <option value="eps">EPS</option> @@ -213,9 +214,7 @@ <option value="default" selected="true">Default</option> <option value="defined">User defined label options</option> </param> - <when value="default"> - <!--Do nothing here --> - </when> + <when value="default"/> <when value="defined"> <param name="size" type="float" value="12" label="Axis label size (default = 12)"/> <param name="color" type="select" label="Color of axis label"> @@ -293,4 +292,33 @@ <filter>out['additional_output_format'] != "none"</filter> </data> </xml> + <xml name="points_options"> + <conditional name="points"> + <param name="pointoptions" type="select" label="Data point options"> + <option value="default" selected="true">Default</option> + <option value="defined">User defined point options</option> + </param> + <when value="default"> + <!--Do nothing here --> + </when> + <when value="defined"> + <param name="size" type="float" value="1" label="relative size of points" /> + <param name="alpha" type="float" value="1" label="Transparency of points (On a scale of 0-1; 0=transparent, 1=default)" /> + <param name="pointcolor" type="select" label="Color of data points" > + <option value="black">Black (default)</option> + <option value="red">Red</option> + <option value="white">White</option> + <option value="blue">Blue</option> + <option value="orange">Orange</option> + <option value="yellow">Yellow</option> + <option value="green">Green</option> + <option value="purple">Purple</option> + <option value="magenta">Magenta</option> + <option value="cyan">Cyan</option> + <option value="grey">Grey</option> + <option value="gold">Gold</option> + </param> + </when> + </conditional> + </xml> </macros>