annotate cdf.xml @ 1:900fd0a7428d default tip

Uploaded
author xuebing
date Sat, 31 Mar 2012 23:06:24 -0400
parents a1d49f6b3180
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
1 <tool id="cdf" name="CDF">
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
2 <description>plot of multiple numeric columns</description>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
3 <command>cat $script_file | R --vanilla --slave > $out_log </command>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
4 <inputs>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
5 <param name="title" type="text" value="CDF plot" size="30" label="Plot title"/>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
6 <param name="xlabel" type="text" value="value" size="30" label="xlabel"/>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
7 <param name="log" label="log2 transform the data" type="boolean" truevalue="log" falsevalue="none" checked="False"/>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
8 <param name="zero" label="remove zero" type="boolean" truevalue="zero" falsevalue="none" checked="False"/>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
9 <param name="legendloc" type="select" label="legend location on CDF plot" >
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
10 <option value="bottomright" selected="true">bottomright</option>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
11 <option value="bottomleft">bottomleft</option>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
12 <option value="bottom">bottom</option>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
13 <option value="left">left</option>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
14 <option value="topleft">topleft</option>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
15 <option value="top">top</option>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
16 <option value="topright">topright</option>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
17 <option value="right">right</option>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
18 <option value="center">center</option>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
19 </param>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
20 <repeat name="series" title="sample">
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
21 <param name="label" type="text" value="" size="30" label="data label"/>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
22 <param name="input" type="data" format="tabular" label="dataset"/>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
23 <param name="column" type="integer" value="2" label="column number (-1 for last column)"/>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
24 </repeat>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
25
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
26 </inputs>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
27
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
28 <configfiles>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
29 <configfile name="script_file">
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
30 ## Setup R error handling to go to stderr
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
31 options(warn=-1)
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
32 source("/Users/xuebing/galaxy-dist/tools/mytools/cdf.r")
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
33 uselog = as.character("${log}")
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
34 zero = as.character("${zero}")
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
35 title = as.character("${title}")
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
36 xlabel = as.character("${xlabel}")
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
37 if (uselog=='log'){
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
38 xlabel = paste('log2',xlabel)
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
39 }
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
40
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
41 labels = character(0)
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
42 x = list()
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
43 #for $i, $s in enumerate( $series )
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
44 labels = c(labels,"${s.label.value}")
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
45 x0 = read.table( "${s.input.file_name}" ,sep='\t')
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
46 col = ${s.column.value}
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
47 if (col == -1) {col = ncol(x0)}
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
48 x0 = x0[,col]
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
49 if (zero == 'zero'){
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
50 x0 = x0[x0 != 0]
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
51 }
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
52 if (uselog=='log'){
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
53 x0=log2(1+x0)
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
54 }
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
55 print("${s.label.value}")
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
56 summary(x0)
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
57 x[[$i+1]] = x0
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
58 #end for
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
59 pdf("${out_file}")
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
60 mycdf(x,title,labels,"${legendloc}",xlabel,'')
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
61 dev.off()
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
62 </configfile>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
63 </configfiles>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
64
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
65 <outputs>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
66 <data format="txt" name="out_log" label="${tool.name} on ${on_string}: (log)" />
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
67 <data format="pdf" name="out_file" label="${tool.name} on ${on_string}: (plot)" />
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
68 </outputs>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
69
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
70 <help>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
71
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
72 .. class:: infomark
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
73
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
74 This tool generate barplot and CDF plot comparing multiple numeric columns in different files.
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
75
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
76
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
77 </help>
a1d49f6b3180 Uploaded
xuebing
parents:
diff changeset
78 </tool>