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