comparison wiggle_correlation.xml @ 0:3d1097835b2f draft default tip

Imported from capsule None
author jjohnson
date Mon, 22 Sep 2014 11:54:41 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:3d1097835b2f
1 <tool name="Multiple wiggle files correlation" id="correlation_dataset" version="0.1.0">
2 <description>Calculate the correlation coefficient on the genome scale using multiple wiggle / bigwig files in fix-sized windows</description>
3 <macros>
4 <import>corr_macros.xml</import>
5 </macros>
6 <expand macro="requirements" />
7 <command>
8 #if $maxscore and $minscore and ( $minscore > $maxscore ):
9 echo "maxscore has to be greater than minscore!"
10 exit 1;
11 #end if
12 #if $wfile1.extension == "wig"
13 wig_correlation.py -d $wfile1.metadata.dbkey -m $method
14 #elif $wfile1.extension == "bigwig"
15 bigwig_correlation.py
16 #end if
17 #if $maxscore.value
18 --max-score $maxscore
19 #end if
20 #if $minscore.value
21 --min-score $minscore
22 #end if
23 $heatmap -s $step -z $size -f PDF -r tmp.r
24 $wfile1 -l '$wlabel1' $wfile2 -l '$wlabel2'
25 #for $m in $more
26 $m.wig -l "$m.label"
27 #end for
28 &amp;> $log &amp;&amp;
29 cp tmp.r $rscript &amp;&amp;
30 #if $imagetype.__str__ == "PNG":
31 convert tmp.r.pdf tmp.r.png &amp;&amp;
32 cp tmp.r.png $output
33 #else
34 cp tmp.r.pdf $output
35 #end if
36 </command>
37 <inputs>
38 <param format="wig,bigwig" name="wfile1" type="data" label="Wiggle / bigwig file 1">
39 <validator type="unspecified_build" />
40 </param>
41 <param name="wlabel1" type="text" label="Wiggle / bigwig label 1" optional="false">
42 <validator type="length" message="must be between 1 and 255 characters" min="1" max="255"/>
43 </param>
44 <param format="wig,bigwig" name="wfile2" type="data" label="Wiggle / bigwig file 2">
45 <validator type="unspecified_build" />
46 </param>
47 <param name="wlabel2" type="text" label="Wiggle / bigwig label 2" optional="false">
48 <validator type="length" message="must be between 1 and 255 characters" min="1" max="255"/>
49 </param>
50 <repeat name="more" title="wiggle / bigwig file">
51 <param format="wig,bigwig" name="wig" type="data" label="Select another wiggle / bigwig file"/>
52 <param name="label" type="text" label="Wiggle / bigwig label" optional="false">
53 <validator type="length" message="must be between 1 and 255 characters" min="1" max="255"/>
54 </param>
55 </repeat>
56 <param name="step" type="integer" label="Step" value="100" help="step in kbps. It must be >= 1. Default: 100">
57 <validator type="in_range" max="1000" min="1" message="Step is out of range, Step has to be between 1 to 1000" />
58 </param>
59 <param name="method" type="select" label="method:" help="method to process the paired two sets of data in the sampling step." >
60 <option value="mean" selected="true">mean</option>
61 <option value="median">median</option>
62 <option value="sample">sample</option>
63 </param>
64 <param name="maxscore" type="float" label="Max Score" help="Maximum score in the calculation (optional)" value="10000" optional="true"/>
65 <param name="minscore" type="float" label="Min Score" help="Minimum score in the calculation (optional)" value="-10000" optional="true"/>
66 <param name="heatmap" type="boolean" label="Draw Heatmap instead?" checked="no"
67 truevalue="-H" falsevalue=" " />
68 <param name="size" type="integer" label="image Size" value="10" help="Image size in inch. It must be ge 5 and le 20. Default: 10">
69 <validator type="in_range" max="20" min="5" message="image Size is out of range, image Size has to be between 5 to 20" />
70 </param>
71 <param type="select" name="imagetype" display="radio" label="Image Type">
72 <option value="PDF">PDF format</option>
73 <option value="PNG">PNG format</option>
74 </param>
75 </inputs>
76 <outputs>
77 <data format="png" name="output">
78 <change_format>
79 <when input="imagetype" value="PDF" format="pdf" />
80 </change_format>
81 </data>
82 <data format="txt" name="log" label="correlation job log" />
83 <data format="txt" name="rscript" label="correlation job rscript" />
84 </outputs>
85 <expand macro="stdio"/>
86 <tests>
87 <test>
88 <param name="wfile1" value="control.wig" />
89 <param name="wlabel1" value="control" />
90 <param name="wfile2" value="treatment.wig" />
91 <param name="wlabel2" value="treatment" />
92 <param name="step" value="100" />
93 <param name="method" value="mean" />
94 <param name="maxscore" value="10000" />
95 <param name="minscore" value="-10000" />
96 <param name="size" value="10" />
97 <param name="imagetype" value="PDF" />
98 <output name="log">
99 <assert_contents>
100 <has_text_matching expression="Please check tmp.r" />
101 </assert_contents>
102 </output>
103 </test>
104 </tests>
105 <help>
106 This tool calculates the correlation coefficient values on the genome
107 scale using many scores datasets (many wiggle files). The tool is
108 written by Tao Liu. It calls R for plotting.
109
110 .. class:: warningmark
111
112 **NEED IMPROVEMENT**
113
114 -----
115
116 **Parameters**
117
118 - **Wiggle file 1 and 2** are the first two wiggle files to be
119 included. These two are required.
120 - **Wiggle label 1 and 2** are the first two wiggle labels to be
121 plotted in the correlation plot.
122 - **wiggle files** click *Add new wiggle file* to add more wiggle
123 files and labels.
124 - **Genome/Assembly** Genome assembly to be used. The tool will
125 download the chromosome information from UCSC database.
126 - **Step** Step in kilo basepairs. The step is a window to extract the
127 scores from wiggle files along the whole genome. So that every step
128 size window will have a value to represent it by using certain **Method**
129 - **Method** When scores are extracted for a step size window, a
130 method will be applied to calculate a value to represent this
131 window. Options are *median* to use the median value or *mean* to
132 use the average value.
133 - **Max Score** is the maximum score in the calculation. It's
134 optional.
135 - **Min Score** is the minimum score in the calculation. It's
136 optional.
137
138 -----
139
140 **Outputs**
141
142 - **PNG file** is the correlation plot
143 - **LOG file** for job log. If you see errors, please attached this in
144 the bug report
145
146 </help>
147
148 </tool>