annotate mytools/cdf.xml @ 9:87eb5c5ddfe9

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