diff 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
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>