annotate cdf.xml @ 11:b7f1d9f8f3bc

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