comparison loadandplot.xml @ 0:1e677d6b1aaf draft

IWTomics v1.0 uploaded
author fabio
date Tue, 02 May 2017 11:05:18 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1e677d6b1aaf
1 <tool id="loadandplot" name="IWTomics Load" version="0.1.0">
2 <description>Smooth and Plot</description>
3 <command interpreter="Rscript">
4 <![CDATA[
5 loadandplot.R outrdata="${outrdata}" outregions="${outregions}" outfeatures="${outfeatures}" outpdf="${outpdf}"
6
7 #set region_paths = '"\\|"'.join( [ str( $r ) for $r in $regions ] )
8 regionspaths="${region_paths}"
9 #set region_galaxyids = '","'.join( [ str( $r.hid ) for $r in $regions ] )
10 regionsgalaxyids="c(${region_galaxyids})"
11 #set region_names = '"\\|"'.join( [ str( $r.name ) for $r in $regions ] )
12 regionsfilenames="${region_names}"
13 #set region_header = '"\\|"'.join( [ str( $rh.regionsheader ) for $rh in $regionsheaderrepeat ] )
14 #if $region_header != "":
15 regionsheaderfile="${region_header}"
16 #end if
17
18 #set feature_paths = '"\\|"'.join( [ str( $f ) for $f in $features ] )
19 featurespaths="${feature_paths}"
20 #set feature_galaxyids = '","'.join( [ str( $f.hid ) for $f in $features ] )
21 featuresgalaxyids="c(${feature_galaxyids})"
22 #set feature_names = '"\\|"'.join( [ str( $f.name ) for $f in $features ] )
23 featuresfilenames="${feature_names}"
24 #set feature_header = '"\\|"'.join( [ str( $fh.featuresheader ) for $fh in $featuresheaderrepeat ] )
25 #if $feature_header != "":
26 featuresheaderfile="${feature_header}"
27 #end if
28
29 smoothing="'${conditionaltype.smoothing}'"
30 start.are.0based="${zerobased}"
31 #if $conditionaltype.smoothing == 'no':
32 alignment="'${conditionaltype.alignment}'"
33 #elif $conditionaltype.smoothing == 'locpoly':
34 alignment="'${conditionaltype.locpolyconditionalscale.alignment}'"
35 #if $conditionaltype.locpolyconditionalscale.alignment == 'scale':
36 scale="${conditionaltype.locpolyconditionalscale.scalegrid}"
37 #end if
38 bandwidth="${conditionaltype.locpolybandwidth}"
39 degree="${conditionaltype.locpolydegree}"
40 fill_gaps="${conditionaltype.fillgaps}"
41 #elif $conditionaltype.smoothing == 'kernel':
42 alignment="'${conditionaltype.kernelconditionalscale.alignment}'"
43 #if $conditionaltype.kernelconditionalscale.alignment == 'scale':
44 scale="${conditionaltype.kernelconditionalscale.scalegrid}"
45 #end if
46 bandwidth="${conditionaltype.kernelbandwidth}"
47 fill_gaps="${conditionaltype.fillgaps}"
48 #elif $conditionaltype.smoothing == 'splines':
49 alignment="'${conditionaltype.splinesconditionalscale.alignment}'"
50 #if $conditionaltype.splinesconditionalscale.alignment == 'scale':
51 scale="${conditionaltype.splinesconditionalscale.scalegrid}"
52 #end if
53 degree="${conditionaltype.splinesdegree}"
54 dist_knots="${conditionaltype.splinesdistknots}"
55 fill_gaps="${conditionaltype.fillgaps}"
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 >& /dev/null
71 ]]>
72 <!--
73 to print the stack add the following line at the end of the command and enable the corresponding entry in output
74 2> "${stackerr}"
75 -->
76 </command>
77
78 <inputs>
79 <!-- regions -->
80 <param format="tabular" name="regions" type="data" label="Select region files" multiple="true" help="" />
81 <repeat name="regionsheaderrepeat" title="Header file for regions (optional)" min="0" max="1" 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.">
82 <param format="tabular" name="regionsheader" type="data" label="Select header file" />
83 </repeat>
84
85 <!-- features -->
86 <param format="tabular" name="features" type="data" label="Select feature files" multiple="true" help="" />
87 <repeat name="featuresheaderrepeat" title="Header file for features (optional)" min="0" max="1" 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.">
88 <param format="tabular" name="featuresheader" type="data" label="Select header file" />
89 </repeat>
90
91 <!-- zero-base one-base -->
92 <param name="zerobased" type="select" label="Start positions are:" multiple="false" help="">
93 <option value="TRUE">0-based</option>
94 <option value="FALSE">1-based</option>
95 </param>
96
97 <!-- conditional smoothing -->
98 <conditional name="conditionaltype">
99 <!-- smoothing -->
100 <param name="smoothing" type="select" label="Smoothing" help="Type of smoothing to be applied to the feature curves.">
101 <option value="no">No</option>
102 <option value="locpoly">Local Polynomials</option>
103 <option value="kernel">Gaussian Kernel</option>
104 <option value="splines">B-Splines</option>
105 </param>
106 <!-- conditional choice: smoothing=no -->
107 <when value="no">
108 <param name="alignment" type="select" label="Region alignment" help="">
109 <option value="center">Center - Alignment on the central position</option>
110 <option value="left">Left - Alignment on the starting position</option>
111 <option value="right">Right - Alignment on the ending position</option>
112 </param>
113 </when>
114 <!-- conditional choice: smoothing=locpoly -->
115 <when value="locpoly">
116 <!-- conditional region alignment -->
117 <conditional name="locpolyconditionalscale">
118 <param name="alignment" type="select" label="Region alignment" help="">
119 <option value="center">Center - Alignment on the central position</option>
120 <option value="left">Left - Alignment on the starting position</option>
121 <option value="right">Right - Alignment on the ending position</option>
122 <option value="scale">Scale - Scaling all regions to the same length</option>
123 </param>
124 <when value="scale">
125 <param name="scalegrid" type="integer" value="0" min="0" label="Number of grid points" help="Number of equally-spaced grid points over which the smoothed curves are evaluated." />
126 </when>
127 </conditional>
128
129 <param name="locpolybandwidth" type="integer" value="5" min="2" label="Bandwidth for smoothing" help="" />
130 <param name="locpolydegree" type="integer" value="3" min="0" label="Degree of local polynomial" help="" />
131
132 <!-- fill gaps -->
133 <param name="fillgaps" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Use smoothing to fill gaps (NA measurements)" help="" />
134 </when>
135 <!-- conditional choice: smoothing=kernel -->
136 <when value="kernel">
137 <!-- conditional region alignment -->
138 <conditional name="kernelconditionalscale">
139 <param name="alignment" type="select" label="Region alignment" help="">
140 <option value="center">Center - Alignment on the central position</option>
141 <option value="left">Left - Alignment on the starting position</option>
142 <option value="right">Right - Alignment on the ending position</option>
143 <option value="scale">Scale - Scaling all regions to the same length</option>
144 </param>
145 <when value="scale">
146 <param name="scalegrid" type="integer" value="0" min="0" label="Number of grid points" help="Number of equally-spaced grid points over which the smoothed curves are evaluated." />
147 </when>
148 </conditional>
149
150 <param name="kernelbandwidth" type="integer" value="5" min="2" label="Bandwidth for smoothing" help="" />
151
152 <!-- fill gaps -->
153 <param name="fillgaps" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Use smoothing to fill gaps (NA measurements)" help="" />
154 </when>
155 <!-- conditional choice: smoothing=splines -->
156 <when value="splines">
157 <!-- conditional region alignment -->
158 <conditional name="splinesconditionalscale">
159 <param name="alignment" type="select" label="Region alignment" help="">
160 <option value="center">Center - Alignment on the central position</option>
161 <option value="left">Left - Alignment on the starting position</option>
162 <option value="right">Right - Alignment on the ending position</option>
163 <option value="scale">Scale - Scaling all regions to the same length</option>
164 </param>
165 <when value="scale">
166 <param name="scalegrid" type="integer" value="0" min="0" label="Number of grid points" help="Number of equally-spaced grid points over which the smoothed curves are evaluated." />
167 </when>
168 </conditional>
169
170 <param name="splinesdegree" type="integer" value="3" min="0" label="Degree of B-splines" help="" />
171 <param name="splinesdistknots" type="integer" value="10" min="2" label="Distance between nodes (approximate)" help="" />
172
173 <!-- fill gaps -->
174 <param name="fillgaps" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Use smoothing to fill gaps (NA measurements)" help="" />
175 </when>
176 </conditional>
177
178 <!-- plot IWTomics results -->
179 <section name="plotres" title="Plot data" expanded="True">
180 <!-- average -->
181 <param name="average" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Plot the mean curves" help="" />
182 <!-- sample size in each position -->
183 <param name="size" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Plot sample size in each position" help="" />
184 <!-- conditional plot type -->
185 <conditional name="conditionalplottype">
186 <!-- plot type -->
187 <param name="plottype" type="select" label="Plot type" help="">
188 <option value="boxplot">Pointwise quantile curves (boxplot)</option>
189 <option value="curves">Curves (aligned)</option>
190 </param>
191 <!-- conditional choice: plottype=boxplot -->
192 <when value="boxplot">
193 <section name="probabilitiessection" title="Probabilities" expanded="True" help="Probabilities corresponding to the quantile curves to be drawn.">
194 <param name="prob0" size="3" type="float" value="0.25" min="0.0" max="1.0" label="Probability" />
195 <param name="prob1" size="3" type="float" value="0.5" min="0.0" max="1.0" label="Probability" />
196 <param name="prob2" size="3" type="float" value="0.75" min="0.0" max="1.0" label="Probability" />
197 <repeat name="probabilities" title="Probabilities">
198 <param name="prob" size="3" type="float" value="0.5" min="0.0" max="1.0" label="Probability" />
199 </repeat>
200 </section>
201 </when>
202 </conditional>
203 </section>
204 </inputs>
205
206 <outputs>
207 <!--<data format="txt" name="stackerr" label="iwtomics.loadandplot.stackerr.txt" from_work_dir="iwtomics.loadandplot.stackerr.txt" />-->
208 <data format="rdata" name="outrdata" label="${tool.name} on ${on_string}: IWTomicsData Object" from_work_dir="iwtomics.loadandplot.RData" />
209 <data format="tabular" name="outregions" label="${tool.name} on ${on_string}: Region Dataset IDs" from_work_dir="iwtomics.loadandplot.regions.txt" />
210 <data format="tabular" name="outfeatures" label="${tool.name} on ${on_string}: Feature IDs" from_work_dir="iwtomics.loadandplot.features.txt" />
211 <data format="pdf" name="outpdf" label="${tool.name} on ${on_string}: Plotted Data" from_work_dir="iwtomics.loadandplot.pdf" />
212 </outputs>
213
214 <help>
215 This tool imports a collection of genomic region datasets, and associates to each region
216 multiple genomic feature measurements. It allows to align the regions in multiple ways
217 (center, left, right or scale alignment), to smooth the feature curves (possibly filling gaps in the
218 measurements) and to create a graphical representation of the feature measurements in each
219 region datasets (aligned curves or pointwise quantile curves).
220
221 -----
222
223 **Region datasets**
224
225 Each region dataset can be provided as a BED or Tabular file with tab delimited columns chr
226 start end (extra columns present in the input file are ignored). Regions can be of different
227 length::
228
229 chr2 49960150 50060150
230 chr2 55912445 56012445
231 ...
232
233 -----
234
235 **Feature measurements**
236
237 Feature measurements corresponding to all the regions can be provided as a BED or Tabular
238 file with tab delimited columns chr start end value::
239
240 chr2 49960150 49962150 0.9426
241 chr2 49962150 49964150 0.7816
242 ...
243
244 Each feature must be measured in windows of a fixed size inside all the regions (missing
245 values must be indicated as NA). Another way to import feature measurements is from a
246 Tabular file with the first three columns chr start end corresponding to the different genomic
247 regions, followed on the same row by all the measurements in fixed-size windows::
248
249 chr2 49960150 50060150 0.9426 0.7816 0.8921 ... ... 1.2063
250 chr2 55912445 56012445 0.8719 0.9975 1.1619 ... ... 0.9601
251 ...
252
253 -----
254
255 **Output**
256
257 The tool returns:
258
259 1. RData with the IWTomicsData object, that stores the aligned genomic region datasets, and their associated feature measurements;
260 2. Region dataset identifiers;
261 3. Feature identifiers;
262 4. PDF file with the plotted data.
263
264 1-3 can be used as input of the tool *IWTomics Test and Plot*
265
266 -----
267
268 .. class:: infomark
269
270 **Notes**
271
272 This Galaxy tool has been developed by Fabio Cumbo (Third University of Rome, Italy) and Marzia A. Cremona (The Pennsylvania State University, USA).
273
274 It implements a simplified version of the methods *smooth* and *plot* for *IWTomicsData* objects.
275 The complete version can be found in the *R/Bioconductor* package *IWTomics* (see vignette_).
276
277 .. _vignette: https://bioconductor.org/packages/release/bioc/vignettes/IWTomics/inst/doc/IWTomics.pdf
278 </help>
279
280 <citations>
281 <citation type="bibtex">
282 @ARTICLE{
283 iwt-functional-data,
284 author = {Pini, Alessia and Vantini, Simone},
285 title = {Interval-Wise Testing for functional data},
286 journal = {Journal of Nonparametric Statistics},
287 year = {2017},
288 volume = {29},
289 number = {2},
290 pages = {407-424}
291 }
292 </citation>
293 <citation type="bibtex">
294 @MANUAL{
295 iwtomics,
296 author = {Cremona, Marzia A and Pini, Alessia and Chiaromonte, Francesca and Vantini, Simone},
297 title = {IWTomics: Interval-Wise Testing for Omics Data},
298 note = {R package version 0.99.12},
299 year = {2017}
300 }
301 </citation>
302 </citations>
303
304 <stdio>
305 <exit_code range="255" source="both" level="fatal" description="Missing IWTomics package. Please be sure to have it installed before using this tool." />
306 <exit_code range="10" source="both" level="fatal" description="An error has occurred reading the header file for regions. Please try again." />
307 <exit_code range="11" source="both" level="fatal" description="Not all region files are present in the first column of header file for regions." />
308 <exit_code range="20" source="both" level="fatal" description="An error has occurred reading the header file for features. Please try again." />
309 <exit_code range="21" source="both" level="fatal" description="Not all feature files are present in the first column of header file for features." />
310 <exit_code range="30" source="both" level="fatal" description="An error has occurred reading the data. Please try again." />
311 <exit_code range="31" source="both" level="fatal" description="Not enough columns in input file." />
312 <exit_code range="32" source="both" level="fatal" description="Duplicated regions in region file." />
313 <exit_code range="33" source="both" level="fatal" description="Duplicated windows in feature file." />
314 <exit_code range="34" source="both" level="fatal" description="Overlapping windows in feature file." />
315 <exit_code range="35" source="both" level="fatal" description="Windows in feature files do not cover all regions in region files." />
316 <exit_code range="36" source="both" level="fatal" description="All windows in a feature file must have the same size." />
317 <exit_code range="40" source="both" level="fatal" description="An error has occurred smoothing the data. Please try again." />
318 <regex match="Error" source="both" level="fatal" description="An error has occurred. Please try again." />
319 </stdio>
320
321 </tool>