comparison ggplot_violin.xml @ 0:a597d59df9ee draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ggplot2 commit 6e466ce83e2e5c0dd0ba30356d0488cf74574b8f
author iuc
date Tue, 22 Aug 2017 06:42:56 -0400
parents
children 43778344b955
comparison
equal deleted inserted replaced
-1:000000000000 0:a597d59df9ee
1 <tool id="ggplot2_violin" name="Violin plot w ggplot2" version="@VERSION@">
2 <macros>
3 <import>macros.xml</import>
4 </macros>
5 <expand macro="requirements">
6 <requirement type="package" version="1.4.2">r-reshape2</requirement>
7 </expand>
8 <command detect_errors="exit_code"><![CDATA[
9 cat '$script' &&
10 Rscript '$script' &&
11 mv output_plot.pdf $output1
12 ]]></command>
13 <configfiles>
14 <configfile name="script"><![CDATA[
15
16 @R_INIT@
17
18 ## Import library
19 library("reshape2")
20 library("ggplot2")
21
22 ## Choose between automatically scaled x and y axis or user defined
23 #if $scaling.plot_scaling == "Automatic"
24 gg_scaley = NULL
25 #else
26 gg_scaley = ylim($scaling.yaxismin, $scaling.yaxismax)
27 #end if
28
29 integrated <- read.csv('$input1', sep='\t', header=TRUE)
30 input <- melt(integrated)
31
32 @TRANSFORM@
33
34 #if $drawquartiles == "none"
35 gg_quartile = NULL
36 #else
37 gg_quartile = c(0.25, 0.5, 0.75)
38 #end if
39
40
41 ggplot(input, aes(variable, value)) + geom_violin(scale = "area", colour = '$ggcolor', fill = '$ggfill', draw_quantiles = gg_quartile) +
42 gg_scaley + theme_bw() + xlab('$xlab') + ylab('$ylab') + ggtitle('$title')
43
44 ggsave(file='output_plot.pdf')
45 dev.off()
46
47 ]]></configfile>
48 </configfiles>
49 <inputs>
50 <param name="input1" type="data" format="tabular" label="Input in tabular format"
51 help="Column headers are requirement. These will be the columns that are plotted."/>
52 <expand macro="title" />
53 <expand macro="xy_lab" />
54 <conditional name="scaling">
55 <param name="plot_scaling" type="select" label="Advanced - Axis scaling">
56 <option value="Automatic" selected="True">Automatic axis scaling</option>
57 <option value="Defined">User deined axis scales</option>
58 </param>
59 <when value="Automatic" />
60 <when value="Defined">
61 <param name="yaxismin" type="integer" value="0" label="minimal range of y-axis" />
62 <param name="yaxismax" type="integer" value="3" label="maximal range of y-axis" />
63 </when>
64 </conditional>
65 <expand macro="transform" />
66 <param name="drawquartiles" type="select" label="Advanced - indicate quartiles of your data">
67 <option value="none">Plot the data without indicating quartiles</option>
68 <option value="indicate">Draw lines to indicate each quartile</option>
69 </param>
70 <param name="ggfill" type="select" label="Advanced - violin color options">
71 <option value="blue" selected="True">Default (Blue)</option>
72 <option value="black">Black</option>
73 <option value="red">Red</option>
74 <option value="white">White</option>
75 <option value="orange">Orange</option>
76 <option value="yellow">Yellow</option>
77 <option value="green">Green</option>
78 <option value="purple">Purple</option>
79 <option value="magenta">Magenta</option>
80 <option value="cyan">Cyan</option>
81 <option value="grey">Grey</option>
82 <option value="gold">Gold</option>
83 </param>
84 <param name="ggcolor" type="select" label="Advanced - violin border options">
85 <option value="yellow" selected="True">Default (Yellow)</option>
86 <option value="black">Black</option>
87 <option value="red">Red</option>
88 <option value="white">White</option>
89 <option value="blue">Blue</option>
90 <option value="orange">Orange</option>
91 <option value="green">Green</option>
92 <option value="purple">Purple</option>
93 <option value="magenta">Magenta</option>
94 <option value="cyan">Cyan</option>
95 <option value="grey">Grey</option>
96 <option value="gold">Gold</option>
97 </param>
98 </inputs>
99 <outputs>
100 <data name="output1" format="pdf" from_work_dir="Rplot.pdf"/>
101 </outputs>
102 <tests>
103 <test>
104 <param name="input1" value="mtcars.txt" ftype="tabular"/>
105 <output name="output1" file="ggplot_violin_result1.pdf" compare="sim_size"/>
106 </test>
107 </tests>
108 <help><![CDATA[
109 Supply this tool with a text file with headers indicating the various groups to be plotted. This tool will sniff out each column with values that can be plotted and display the distribution of that data group. Note that columns may be excluded from this plot if they contain questionable characters.
110
111 ]]></help>
112 <expand macro="citations"/>
113 </tool>