0
|
1 <tool id="batch_plot" name="batch plot" version="0.1">
|
|
2 <description>Batch plot in R</description>
|
|
3 <command interpreter="bash">r_wrapper.sh $script_file</command>
|
|
4
|
|
5 <inputs>
|
|
6 <param name="input" type="data" format="tabular" label="Data to plot (tab separated)"/>
|
|
7 <param name="group" type="text" value="Group" label="Name of Column to Group (case-sensitive, avoid spaces)"/>
|
|
8 </inputs>
|
|
9
|
|
10 <configfiles>
|
|
11 <configfile name="script_file">
|
|
12 ## Setup R error handling to go to stderr
|
|
13 options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
|
|
14
|
|
15 data=read.table("${input}",sep="\t",header=TRUE)
|
|
16 pdf("${output}");
|
|
17 with(data, { sapply(names(data[,sapply(data, is.numeric)]), function(x) { boxplot(data[[x]] ~ $group); points(data[[x]] ~ $group); title(x);} ); "OK" } );
|
|
18 dev.off();
|
|
19
|
|
20 </configfile>
|
|
21 </configfiles>
|
|
22
|
|
23 <outputs>
|
|
24 <data format="pdf" name="output" />
|
|
25 </outputs>
|
|
26
|
|
27 <tests>
|
|
28 <test>
|
|
29 <param name="input" value="test_counts.tab"/>
|
|
30 <output name="out_file" file="output.pdf"/>
|
|
31 </test>
|
|
32 </tests>
|
|
33
|
|
34 <help>
|
|
35
|
|
36 .. class:: infomark
|
|
37
|
|
38 This tool makes a PDF of groups of box plots from a tabulated file.
|
|
39 It creates one plot per column, each one grouped by a user-specific column (by default named Group).
|
|
40 The title of each plot is the name of the column being plotted.
|
|
41
|
|
42 -----
|
|
43
|
|
44
|
|
45 **Example**
|
|
46
|
|
47 </help>
|
|
48 </tool> |