Mercurial > repos > iuc > ggplot2_violin
comparison ggplot_violin.xml @ 2:43778344b955 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:05:43 -0400 |
parents | a597d59df9ee |
children | dfd5d981b5a4 |
comparison
equal
deleted
inserted
replaced
1:d85535076554 | 2:43778344b955 |
---|---|
1 <tool id="ggplot2_violin" name="Violin plot w ggplot2" version="@VERSION@"> | 1 <tool id="ggplot2_violin" name="Violin plot w ggplot2" version="@VERSION@+galaxy0"> |
2 <macros> | 2 <macros> |
3 <import>macros.xml</import> | 3 <import>macros.xml</import> |
4 </macros> | 4 </macros> |
5 <expand macro="requirements"> | 5 <expand macro="requirements"> |
6 <requirement type="package" version="1.4.2">r-reshape2</requirement> | 6 <requirement type="package" version="1.4.3">r-reshape2</requirement> |
7 <requirement type="package" version="1.2.1">r-svglite</requirement> | |
7 </expand> | 8 </expand> |
8 <command detect_errors="exit_code"><![CDATA[ | 9 <command detect_errors="exit_code"><![CDATA[ |
9 cat '$script' && | 10 cat '$script' && |
10 Rscript '$script' && | 11 Rscript '$script' |
11 mv output_plot.pdf $output1 | |
12 ]]></command> | 12 ]]></command> |
13 <configfiles> | 13 <configfiles> |
14 <configfile name="script"><![CDATA[ | 14 <configfile name="script"><![CDATA[ |
15 | |
16 @R_INIT@ | 15 @R_INIT@ |
17 | 16 |
18 ## Import library | 17 ## Import library |
19 library("reshape2") | 18 library("reshape2") |
20 library("ggplot2") | 19 library("ggplot2") |
21 | 20 |
22 ## Choose between automatically scaled x and y axis or user defined | 21 ## Automatically scaled y axis or user defined |
23 #if $scaling.plot_scaling == "Automatic" | 22 ## marco not possible because on y asis relevent |
23 #if $adv.scaling.plot_scaling == "Automatic" | |
24 gg_scaley = NULL | 24 gg_scaley = NULL |
25 #else | 25 #else |
26 gg_scaley = ylim($scaling.yaxismin, $scaling.yaxismax) | 26 gg_scaley = ylim($adv.scaling.yaxismin, $adv.scaling.yaxismax) |
27 #end if | 27 #end if |
28 | 28 |
29 integrated <- read.csv('$input1', sep='\t', header=TRUE) | 29 integrated <- read.csv('$input1', sep='\t', header=TRUE) |
30 input <- melt(integrated) | 30 input <- melt(integrated) |
31 | 31 |
32 @TRANSFORM@ | 32 @TRANSFORM@ |
33 | 33 |
34 #if $drawquartiles == "none" | 34 @THEME@ |
35 | |
36 @LEGEND@ | |
37 | |
38 #if $adv.drawquartiles == "none" | |
35 gg_quartile = NULL | 39 gg_quartile = NULL |
36 #else | 40 #else |
37 gg_quartile = c(0.25, 0.5, 0.75) | 41 gg_quartile = c(0.25, 0.5, 0.75) |
38 #end if | 42 #end if |
39 | 43 |
44 ## add advanced plotting options for final plot | |
45 plot_out <- ggplot(input, aes(variable, value)) + | |
46 geom_violin(scale = "area", colour = '$adv.ggcolor', fill = '$adv.ggfill', draw_quantiles = gg_quartile) + | |
47 gg_scaley + gg_legend + gg_theme + xlab('$xlab') + ylab('$ylab') + ggtitle('$title') | |
40 | 48 |
41 ggplot(input, aes(variable, value)) + geom_violin(scale = "area", colour = '$ggcolor', fill = '$ggfill', draw_quantiles = gg_quartile) + | 49 @SAVE_OUTPUT@ |
42 gg_scaley + theme_bw() + xlab('$xlab') + ylab('$ylab') + ggtitle('$title') | |
43 | |
44 ggsave(file='output_plot.pdf') | |
45 dev.off() | |
46 | |
47 ]]></configfile> | 50 ]]></configfile> |
48 </configfiles> | 51 </configfiles> |
49 <inputs> | 52 <inputs> |
50 <param name="input1" type="data" format="tabular" label="Input in tabular format" | 53 <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."/> | 54 help="Column headers are requirement. These will be the columns that are plotted."/> |
52 <expand macro="title" /> | 55 <expand macro="title" /> |
53 <expand macro="xy_lab" /> | 56 <expand macro="xy_lab" /> |
54 <conditional name="scaling"> | 57 <section name="adv" title="Advanced Options" expanded="false"> |
55 <param name="plot_scaling" type="select" label="Advanced - Axis scaling"> | 58 <param name="drawquartiles" type="select" label="Indicate quartiles of your data"> |
56 <option value="Automatic" selected="True">Automatic axis scaling</option> | 59 <option value="none">Plot the data without indicating quartiles</option> |
57 <option value="Defined">User deined axis scales</option> | 60 <option value="indicate">Draw lines to indicate each quartile</option> |
58 </param> | 61 </param> |
59 <when value="Automatic" /> | 62 <param name="ggfill" type="select" label="Violin color options"> |
60 <when value="Defined"> | 63 <option value="blue" selected="true">Default (Blue)</option> |
61 <param name="yaxismin" type="integer" value="0" label="minimal range of y-axis" /> | 64 <option value="black">Black</option> |
62 <param name="yaxismax" type="integer" value="3" label="maximal range of y-axis" /> | 65 <option value="red">Red</option> |
63 </when> | 66 <option value="white">White</option> |
64 </conditional> | 67 <option value="orange">Orange</option> |
65 <expand macro="transform" /> | 68 <option value="yellow">Yellow</option> |
66 <param name="drawquartiles" type="select" label="Advanced - indicate quartiles of your data"> | 69 <option value="green">Green</option> |
67 <option value="none">Plot the data without indicating quartiles</option> | 70 <option value="purple">Purple</option> |
68 <option value="indicate">Draw lines to indicate each quartile</option> | 71 <option value="magenta">Magenta</option> |
69 </param> | 72 <option value="cyan">Cyan</option> |
70 <param name="ggfill" type="select" label="Advanced - violin color options"> | 73 <option value="grey">Grey</option> |
71 <option value="blue" selected="True">Default (Blue)</option> | 74 <option value="gold">Gold</option> |
72 <option value="black">Black</option> | 75 </param> |
73 <option value="red">Red</option> | 76 <param name="ggcolor" type="select" label="Violin border options"> |
74 <option value="white">White</option> | 77 <option value="yellow" selected="true">Default (Yellow)</option> |
75 <option value="orange">Orange</option> | 78 <option value="black">Black</option> |
76 <option value="yellow">Yellow</option> | 79 <option value="red">Red</option> |
77 <option value="green">Green</option> | 80 <option value="white">White</option> |
78 <option value="purple">Purple</option> | 81 <option value="blue">Blue</option> |
79 <option value="magenta">Magenta</option> | 82 <option value="orange">Orange</option> |
80 <option value="cyan">Cyan</option> | 83 <option value="green">Green</option> |
81 <option value="grey">Grey</option> | 84 <option value="purple">Purple</option> |
82 <option value="gold">Gold</option> | 85 <option value="magenta">Magenta</option> |
83 </param> | 86 <option value="cyan">Cyan</option> |
84 <param name="ggcolor" type="select" label="Advanced - violin border options"> | 87 <option value="grey">Grey</option> |
85 <option value="yellow" selected="True">Default (Yellow)</option> | 88 <option value="gold">Gold</option> |
86 <option value="black">Black</option> | 89 </param> |
87 <option value="red">Red</option> | 90 <expand macro="transform" /> |
88 <option value="white">White</option> | 91 <conditional name="scaling"> |
89 <option value="blue">Blue</option> | 92 <param name="plot_scaling" type="select" label="Axis scaling"> |
90 <option value="orange">Orange</option> | 93 <option value="Automatic" selected="true">Automatic axis scaling</option> |
91 <option value="green">Green</option> | 94 <option value="Defined">User deined axis scales</option> |
92 <option value="purple">Purple</option> | 95 </param> |
93 <option value="magenta">Magenta</option> | 96 <when value="Automatic" /> |
94 <option value="cyan">Cyan</option> | 97 <when value="Defined"> |
95 <option value="grey">Grey</option> | 98 <param name="yaxismin" type="integer" value="0" label="minimal range of y-axis" /> |
96 <option value="gold">Gold</option> | 99 <param name="yaxismax" type="integer" value="3" label="maximal range of y-axis" /> |
97 </param> | 100 </when> |
101 </conditional> | |
102 <expand macro="xy_scaling" /> | |
103 <expand macro="theme" /> | |
104 <expand macro="legend" /> | |
105 </section> | |
106 <section name="out" title="Output Options" expanded="true"> | |
107 <expand macro="dimensions" /> | |
108 </section> | |
98 </inputs> | 109 </inputs> |
99 <outputs> | 110 <outputs> |
100 <data name="output1" format="pdf" from_work_dir="Rplot.pdf"/> | 111 <expand macro="additional_output" /> |
101 </outputs> | 112 </outputs> |
102 <tests> | 113 <tests> |
103 <test> | 114 <test> |
104 <param name="input1" value="mtcars.txt" ftype="tabular"/> | 115 <param name="input1" value="mtcars.txt" ftype="tabular"/> |
105 <output name="output1" file="ggplot_violin_result1.pdf" compare="sim_size"/> | 116 <param name="additional_output_format" value="pdf" /> |
117 <output name="output2" file="ggplot_violin_result1.pdf" compare="sim_size"/> | |
106 </test> | 118 </test> |
107 </tests> | 119 </tests> |
108 <help><![CDATA[ | 120 <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. | 121 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> | 122 ]]></help> |
112 <expand macro="citations"/> | 123 <expand macro="citations"/> |
113 </tool> | 124 </tool> |