annotate xy_plot.xml @ 0:acf952549b53 draft

Uploaded tool tarball.
author devteam
date Wed, 25 Sep 2013 11:34:32 -0400
parents
children 1a73a2406edc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
1 <tool id="XY_Plot_1" name="Plotting tool" version="1.0.1">
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
2 <description>for multiple series and graph types</description>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
3 <requirements>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
4 <requirement type="package" version="2.11.0">R</requirement>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
5 </requirements>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
6 <command interpreter="bash">r_wrapper.sh $script_file</command>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
7
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
8 <inputs>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
9 <param name="main" type="text" value="" size="30" label="Plot Title"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
10 <param name="xlab" type="text" value="" size="30" label="Label for x axis"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
11 <param name="ylab" type="text" value="" size="30" label="Label for y axis"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
12 <repeat name="series" title="Series">
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
13 <param name="input" type="data" format="tabular" label="Dataset"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
14 <param name="xcol" type="data_column" data_ref="input" label="Column for x axis"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
15 <param name="ycol" type="data_column" data_ref="input" label="Column for y axis"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
16 <conditional name="series_type">
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
17 <param name="type" type="select" label="Series Type">
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
18 <option value="line" selected="true">Line</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
19 <option value="points">Points</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
20 </param>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
21 <when value="line">
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
22 <param name="lty" type="select" label="Line Type">
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
23 <option value="1">Solid</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
24 <option value="2">Dashed</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
25 <option value="3">Dotted</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
26 </param>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
27 <param name="col" type="select" label="Line Color">
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
28 <option value="1">Black</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
29 <option value="2">Red</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
30 <option value="3">Green</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
31 <option value="4">Blue</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
32 <option value="5">Cyan</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
33 <option value="6">Magenta</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
34 <option value="7">Yellow</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
35 <option value="8">Gray</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
36 </param>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
37 <param name="lwd" type="float" label="Line Width" value="1.0"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
38 </when>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
39 <when value="points">
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
40 <param name="pch" type="select" label="Point Type">
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
41 <option value="1">Circle (hollow)</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
42 <option value="2">Triangle (hollow)</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
43 <option value="3">Cross</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
44 <option value="4">Diamond (hollow)</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
45 <option value="15">Square (filled)</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
46 <option value="16">Circle (filled)</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
47 <option value="17">Triangle (filled)</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
48 </param>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
49 <param name="col" type="select" label="Point Color">
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
50 <option value="1">Black</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
51 <option value="2">Red</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
52 <option value="3">Green</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
53 <option value="4">Blue</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
54 <option value="5">Cyan</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
55 <option value="6">Magenta</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
56 <option value="7">Yellow</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
57 <option value="8">Gray</option>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
58 </param>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
59 <param name="cex" type="float" label="Point Scale" value="1.0"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
60 </when>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
61 </conditional>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
62 </repeat>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
63 </inputs>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
64
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
65 <configfiles>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
66 <configfile name="script_file">
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
67 ## Setup R error handling to go to stderr
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
68 options( show.error.messages=F,
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
69 error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
70 ## Determine range of all series in the plot
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
71 xrange = c( NULL, NULL )
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
72 yrange = c( NULL, NULL )
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
73 #for $i, $s in enumerate( $series )
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
74 s${i} = read.table( "${s.input.file_name}" )
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
75 x${i} = s${i}[,${s.xcol}]
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
76 y${i} = s${i}[,${s.ycol}]
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
77 xrange = range( x${i}, xrange )
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
78 yrange = range( y${i}, yrange )
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
79 #end for
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
80 ## Open output PDF file
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
81 pdf( "${out_file1}" )
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
82 ## Dummy plot for axis / labels
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
83 plot( NULL, type="n", xlim=xrange, ylim=yrange, main="${main}", xlab="${xlab}", ylab="${ylab}" )
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
84 ## Plot each series
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
85 #for $i, $s in enumerate( $series )
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
86 #if $s.series_type['type'] == "line"
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
87 lines( x${i}, y${i}, lty=${s.series_type.lty}, lwd=${s.series_type.lwd}, col=${s.series_type.col} )
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
88 #elif $s.series_type.type == "points"
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
89 points( x${i}, y${i}, pch=${s.series_type.pch}, cex=${s.series_type.cex}, col=${s.series_type.col} )
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
90 #end if
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
91 #end for
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
92 ## Close the PDF file
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
93 devname = dev.off()
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
94 </configfile>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
95 </configfiles>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
96
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
97 <outputs>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
98 <data format="pdf" name="out_file1" />
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
99 </outputs>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
100
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
101 <tests>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
102 <test>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
103 <param name="main" value="Example XY Plot"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
104 <param name="xlab" value="Column 1"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
105 <param name="ylab" value="Column 2"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
106 <param name="input" value="2.tabular" ftype="tabular"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
107 <param name="xcol" value="1"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
108 <param name="ycol" value="2"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
109 <param name="type" value="line"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
110 <param name="lty" value="2"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
111 <param name="col" value="2"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
112 <param name="lwd" value="1.0"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
113 <output name="out_file1" file="XY_Plot_1_out.pdf"/>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
114 </test>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
115 </tests>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
116 <help>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
117 .. class:: infomark
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
118
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
119 This tool allows you to plot values contained in columns of a dataset against each other and also allows you to have different series corresponding to the same or different datasets in one plot.
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
120
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
121 -----
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
122
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
123 .. class:: warningmark
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
124
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
125 This tool throws an error if the columns selected for plotting are absent or are not numeric and also if the lengths of these columns differ.
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
126
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
127 -----
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
128
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
129 **Example**
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
130
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
131 Input file::
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
132
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
133 1 68 4.1
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
134 2 71 4.6
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
135 3 62 3.8
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
136 4 75 4.4
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
137 5 58 3.2
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
138 6 60 3.1
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
139 7 67 3.8
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
140 8 68 4.1
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
141 9 71 4.3
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
142 10 69 3.7
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
143
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
144 Create a two series XY plot on the above data:
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
145
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
146 - Series 1: Red Dashed-Line plot between columns 1 and 2
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
147 - Series 2: Blue Circular-Point plot between columns 3 and 2
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
148
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
149 .. image:: ${static_path}/images/xy_example.jpg
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
150 </help>
acf952549b53 Uploaded tool tarball.
devteam
parents:
diff changeset
151 </tool>