83
|
1 <tool id="iwtomics_loadandplot" name="IWTomics Load" version="@VERSION@.0">
|
|
2 <description>Smooth and Plot</description>
|
|
3 <macros>
|
|
4 <import>macros.xml</import>
|
|
5 </macros>
|
|
6 <expand macro="requirements" />
|
|
7
|
|
8 <command detect_errors="exit_code">
|
|
9 <![CDATA[
|
|
10 Rscript '$__tool_directory__/loadandplot.R' outrdata='${outrdata}' outregions='${outregions}' outfeatures='${outfeatures}' outpdf='${outpdf}'
|
|
11
|
|
12 #set region_paths = '|'.join( [ str( $r ) for $r in $regions ] )
|
|
13 regionspaths='${region_paths}'
|
|
14 #set region_galaxyids = ','.join( [ str( $r.hid ) for $r in $regions ] )
|
|
15 regionsgalaxyids='c(${region_galaxyids})'
|
|
16 #set region_names = '|'.join( [ str( $r.name ) for $r in $regions ] )
|
|
17 regionsfilenames='${region_names}'
|
85
|
18 #if $regionsheader:
|
87
|
19 regionsheaderfile='${regionsheader}'
|
83
|
20 #end if
|
|
21
|
|
22 #set feature_paths = '|'.join( [ str( $f ) for $f in $features ] )
|
|
23 featurespaths='${feature_paths}'
|
|
24 #set feature_galaxyids = ','.join( [ str( $f.hid ) for $f in $features ] )
|
|
25 featuresgalaxyids='c(${feature_galaxyids})'
|
|
26 #set feature_names = '|'.join( [ str( $f.name ) for $f in $features ] )
|
|
27 featuresfilenames='${feature_names}'
|
85
|
28 #if $featuresheader:
|
87
|
29 featuresheaderfile='${featuresheader}'
|
83
|
30 #end if
|
|
31
|
|
32 smoothing="'${conditionaltype.smoothing}'"
|
|
33 start.are.0based='${zerobased}'
|
|
34 #if $conditionaltype.smoothing == 'no':
|
|
35 alignment="'${conditionaltype.alignment}'"
|
|
36 #elif $conditionaltype.smoothing == 'locpoly':
|
|
37 bandwidth='${conditionaltype.locpolybandwidth}'
|
|
38 degree='${conditionaltype.locpolydegree}'
|
|
39 alignment="'${conditionaltype.conditionalscale.alignment}'"
|
|
40 #elif $conditionaltype.smoothing == 'kernel':
|
|
41 bandwidth='${conditionaltype.kernelbandwidth}'
|
|
42 alignment="'${conditionaltype.conditionalscale.alignment}'"
|
|
43 #elif $conditionaltype.smoothing == 'splines':
|
|
44 degree='${conditionaltype.splinesdegree}'
|
|
45 dist_knots='${conditionaltype.splinesdistknots}'
|
|
46 alignment="'${conditionaltype.conditionalscale.alignment}'"
|
|
47 #end if
|
|
48
|
|
49 #if $conditionaltype.smoothing != 'no':
|
|
50 #if $conditionaltype.conditionalscale.alignment == 'scale':
|
|
51 scale='${conditionaltype.conditionalscale.scalegrid}'
|
|
52 fill_gaps='TRUE'
|
|
53 #else
|
|
54 fill_gaps='${conditionaltype.conditionalscale.fillgaps}'
|
|
55 #end if
|
|
56 #end if
|
|
57
|
|
58 average='${plotres.average}'
|
|
59 size='${plotres.size}'
|
|
60 plottype="'${plotres.conditionalplottype.plottype}'"
|
|
61 #if $plotres.conditionalplottype.plottype == 'boxplot':
|
|
62 #set probs = ','.join( [ str( $p.prob ) for $p in $plotres.conditionalplottype.probabilitiessection.probabilities ] )
|
|
63 #if $probs != "":
|
|
64 probs='c(${plotres.conditionalplottype.probabilitiessection.prob0},${plotres.conditionalplottype.probabilitiessection.prob1},${plotres.conditionalplottype.probabilitiessection.prob2},${probs})'
|
|
65 #else:
|
|
66 probs='c(${plotres.conditionalplottype.probabilitiessection.prob0},${plotres.conditionalplottype.probabilitiessection.prob1},${plotres.conditionalplottype.probabilitiessection.prob2})'
|
|
67 #end if
|
|
68 #end if
|
|
69 ]]>
|
|
70 </command>
|
|
71
|
|
72 <inputs>
|
|
73 <!-- regions -->
|
|
74 <param format="tabular" name="regions" type="data" label="Select region files" multiple="true" help="" />
|
|
75 <param format="tabular" name="regionsheader" type="data" label="Insert header file for regions (optional)" optional="true" help="Tabular file. Column 1: names of the region files; Column 2: unique identifiers of the region datasets (spaces and special characters are not allowed); Column 3: name of the region datasets to be used in the output." />
|
|
76
|
|
77 <!-- features -->
|
|
78 <param format="tabular" name="features" type="data" label="Select feature files" multiple="true" help="" />
|
|
79 <param format="tabular" name="featuresheader" type="data" label="Insert header file for features (optional)" optional="true" help="Tabular file. Column 1: names of the feature files; Column 2: unique identifiers of the features (spaces and special characters are not allowed); Column 3: name of the features to be used in the output." />
|
|
80
|
|
81 <!-- zero-base one-base -->
|
|
82 <param name="zerobased" type="select" label="Start positions are:" multiple="false" help="">
|
|
83 <option value="TRUE">0-based</option>
|
|
84 <option value="FALSE">1-based</option>
|
|
85 </param>
|
|
86
|
|
87 <!-- conditional smoothing -->
|
|
88 <conditional name="conditionaltype">
|
|
89 <!-- smoothing -->
|
|
90 <param name="smoothing" type="select" label="Smoothing" help="Type of smoothing to be applied to the feature curves.">
|
|
91 <option value="no">No</option>
|
|
92 <option value="locpoly">Local Polynomials</option>
|
|
93 <option value="kernel">Gaussian Kernel</option>
|
|
94 <option value="splines">B-Splines</option>
|
|
95 </param>
|
|
96 <!-- conditional choice: smoothing=no -->
|
|
97 <when value="no">
|
|
98 <expand macro="alignment" />
|
|
99 </when>
|
|
100 <!-- conditional choice: smoothing=locpoly -->
|
|
101 <when value="locpoly">
|
|
102 <param name="locpolybandwidth" type="integer" value="5" min="2" label="Bandwidth for smoothing" help="" />
|
|
103 <param name="locpolydegree" type="integer" value="3" min="0" label="Degree of local polynomial" help="" />
|
|
104 <!-- conditional region alignment -->
|
|
105 <expand macro="alignment-s" />
|
|
106 </when>
|
|
107 <!-- conditional choice: smoothing=kernel -->
|
|
108 <when value="kernel">
|
|
109 <param name="kernelbandwidth" type="integer" value="5" min="2" label="Bandwidth for smoothing" help="" />
|
|
110 <!-- conditional region alignment -->
|
|
111 <expand macro="alignment-s" />
|
|
112 </when>
|
|
113 <!-- conditional choice: smoothing=splines -->
|
|
114 <when value="splines">
|
|
115 <param name="splinesdegree" type="integer" value="3" min="0" label="Degree of B-splines" help="" />
|
|
116 <param name="splinesdistknots" type="integer" value="10" min="2" label="Distance between nodes (approximate)" help="" />
|
|
117 <!-- conditional region alignment -->
|
|
118 <expand macro="alignment-s" />
|
|
119 </when>
|
|
120 </conditional>
|
|
121
|
|
122 <!-- plot IWTomics results -->
|
|
123 <section name="plotres" title="Plot data" expanded="True">
|
|
124 <expand macro="plot-params" />
|
|
125 </section>
|
|
126 </inputs>
|
|
127
|
|
128 <outputs>
|
|
129 <data format="rdata" name="outrdata" label="${tool.name} on ${on_string}: IWTomicsData Object" from_work_dir="iwtomics.loadandplot.RData" />
|
|
130 <data format="tabular" name="outregions" label="${tool.name} on ${on_string}: Region Dataset IDs" from_work_dir="iwtomics.loadandplot.regions.txt" />
|
|
131 <data format="tabular" name="outfeatures" label="${tool.name} on ${on_string}: Feature IDs" from_work_dir="iwtomics.loadandplot.features.txt" />
|
|
132 <data format="pdf" name="outpdf" label="${tool.name} on ${on_string}: Plotted Data" from_work_dir="iwtomics.loadandplot.pdf" />
|
|
133 </outputs>
|
|
134
|
|
135 <tests>
|
|
136 <test>
|
|
137 <param name="regions" value="input/Controls_regions.bed,input/Elements1_regions.bed,input/Elements2_regions.bed,input/Elements3_regions.bed" ftype="bed" />
|
|
138 <param name="regionsheader" value="input/regions.header.txt" ftype="tabular" />
|
|
139 <param name="features" value="input/Feature1.bed,input/Feature2.bed" ftype="bed" />
|
|
140 <param name="featuresheader" value="input/features.header.bed.txt" ftype="tabular" />
|
|
141 <param name="zerobased" value="TRUE" />
|
|
142 <param name="smoothing" value="kernel" />
|
|
143 <param name="alignment" value="center" />
|
|
144 <param name="kernelbandwidth" value="5" />
|
|
145 <param name="fillgaps" value="TRUE" />
|
|
146 <param name="average" value="TRUE" />
|
|
147 <param name="size" value="TRUE" />
|
|
148 <param name="plottype" value="boxplot" />
|
|
149 <param name="prob0" value="0.25" />
|
|
150 <param name="prob1" value="0.5" />
|
|
151 <param name="prob2" value="0.75" />
|
|
152 <output name="outrdata" file="output_loadandplot/iwtomics.loadandplot.RData" compare="sim_size" />
|
|
153 <output name="outregions" file="output_loadandplot/iwtomics.loadandplot.regions.txt" />
|
|
154 <output name="outfeatures" file="output_loadandplot/iwtomics.loadandplot.features.txt" />
|
|
155 <output name="outpdf" file="output_loadandplot/iwtomics.loadandplot.pdf" compare="sim_size" />
|
|
156 </test>
|
|
157 </tests>
|
|
158
|
|
159 <help><![CDATA[
|
|
160 This tool imports a collection of genomic region datasets, and associates to each region
|
|
161 multiple genomic feature measurements. It allows to align the regions in multiple ways
|
|
162 (center, left, right or scale alignment), to smooth the feature curves (possibly filling gaps in the
|
|
163 measurements) and to create a graphical representation of the feature measurements in each
|
|
164 region datasets (aligned curves or pointwise quantile curves).
|
|
165
|
|
166 -----
|
|
167
|
|
168 **Region datasets**
|
|
169
|
|
170 Each region dataset can be provided as a BED or Tabular file with tab delimited columns chr
|
|
171 start end (extra columns present in the input file are ignored). Regions can be of different
|
|
172 length::
|
|
173
|
|
174 chr2 49960150 50060150
|
|
175 chr2 55912445 56012445
|
|
176 ...
|
|
177
|
|
178 -----
|
|
179
|
|
180 **Feature measurements**
|
|
181
|
|
182 Feature measurements corresponding to all the regions can be provided as a BED or Tabular
|
|
183 file with tab delimited columns chr start end value::
|
|
184
|
|
185 chr2 49960150 49962150 0.9426
|
|
186 chr2 49962150 49964150 0.7816
|
|
187 ...
|
|
188
|
|
189 Each feature must be measured in windows of a fixed size inside all the regions (missing
|
|
190 values must be indicated as NA). Another way to import feature measurements is from a
|
|
191 Tabular file with the first three columns chr start end corresponding to the different genomic
|
|
192 regions, followed on the same row by all the measurements in fixed-size windows::
|
|
193
|
|
194 chr2 49960150 50060150 0.9426 0.7816 0.8921 ... ... 1.2063
|
|
195 chr2 55912445 56012445 0.8719 0.9975 1.1619 ... ... 0.9601
|
|
196 ...
|
|
197
|
|
198 -----
|
|
199
|
|
200 **Output**
|
|
201
|
|
202 The tool returns:
|
|
203
|
|
204 1. RData with the IWTomicsData object, that stores the aligned genomic region datasets, and their associated feature measurements;
|
|
205 2. Region dataset identifiers;
|
|
206 3. Feature identifiers;
|
|
207 4. PDF file with the plotted data.
|
|
208
|
|
209 1-3 can be used as input of the tool *IWTomics Test and Plot*
|
|
210
|
|
211 -----
|
|
212
|
|
213 .. class:: infomark
|
|
214
|
|
215 **Notes**
|
|
216
|
|
217 This Galaxy tool has been developed by Fabio Cumbo (Third University of Rome, Italy - fabio.cumbo@iasi.cnr.it) and Marzia A. Cremona (The Pennsylvania State University, USA - mac78@psu.edu).
|
|
218
|
|
219 It implements a simplified version of the methods *smooth* and *plot* for *IWTomicsData* objects.
|
|
220 The complete version can be found in the *R/Bioconductor* package *IWTomics* (see vignette_).
|
|
221
|
|
222 .. _vignette: https://bioconductor.org/packages/release/bioc/vignettes/IWTomics/inst/doc/IWTomics.pdf
|
|
223
|
|
224 Example data can be found at:
|
|
225
|
|
226 1. Simulated_data_
|
|
227 2. ETn_data_
|
|
228
|
|
229 .. _Simulated_data: https://usegalaxy.org/u/fabio-cumbo/h/iwtomics-example
|
|
230 .. _ETn_data: https://usegalaxy.org/u/fabio-cumbo/h/iwtomics-etn-example
|
|
231 ]]></help>
|
|
232
|
|
233 <expand macro="citations" />
|
|
234
|
|
235 </tool>
|