58
|
1 <tool id="iwtomics_testandplot" name="IWTomics Test" version="@VERSION@.0">
|
18
|
2 <description>and Plot</description>
|
|
3 <macros>
|
|
4 <import>macros.xml</import>
|
|
5 </macros>
|
|
6 <expand macro="requirements" />
|
|
7
|
74
|
8 <command detect_errors="exit_code">
|
18
|
9 <![CDATA[
|
70
|
10 Rscript '$__tool_directory__/testandplot.R' adjustedpvaluematrix='${adjustedpvaluematrix}' iwtomicsrespdf='${iwtomicsrespdf}' iwtomicssumpdf='${iwtomicssumpdf}' iwtomicsrdata='${iwtomicsrdata}' iwtomicstests='${iwtomicstests}' iwtomicsselectedfeatures='${iwtomicsselectedfeatures}'
|
|
11 regionids='${regionids}'
|
|
12 featureids='${featureids}'
|
|
13 rdatafile='${rdata}'
|
18
|
14
|
72
|
15 #set region1 = ','.join( [ str( $r.region0 ) for $r in $regionssection.regions ] )
|
|
16 #set region2 = ','.join( [ str( $r.region1 ) for $r in $regionssection.regions ] )
|
70
|
17 region1='c(${region1})'
|
|
18 region2='c(${region2})'
|
18
|
19
|
70
|
20 features_subset='c(${featureslist})'
|
18
|
21
|
72
|
22 statistics="'${conditionalstatistics.statistics}'"
|
18
|
23 #if $conditionalstatistics.statistics == "quantile":
|
72
|
24 #set probabilities = ','.join( [ str( $p.qprob ) for $p in $conditionalstatistics.quantilesection.qprobabilities ] )
|
70
|
25 testprobs='c(${probabilities})'
|
18
|
26 #end if
|
|
27
|
70
|
28 B='${permutations}'
|
18
|
29
|
70
|
30 testalpha='${plotres.alpha}'
|
|
31 average='${plotres.average}'
|
|
32 size='${plotres.size}'
|
72
|
33 plottype="'${plotres.conditionalplottype.plottype}'"
|
|
34 #if $plotres.conditionalplottype.plottype == "boxplot":
|
|
35 #set probs = ','.join( [ str( $p.prob ) for $p in $plotres.conditionalplottype.probabilitiessection.probabilities ] )
|
18
|
36 #if $probs != "":
|
70
|
37 probs='c(${plotres.conditionalplottype.probabilitiessection.prob0},${plotres.conditionalplottype.probabilitiessection.prob1},${plotres.conditionalplottype.probabilitiessection.prob2},${probs})'
|
18
|
38 #else:
|
70
|
39 probs='c(${plotres.conditionalplottype.probabilitiessection.prob0},${plotres.conditionalplottype.probabilitiessection.prob1},${plotres.conditionalplottype.probabilitiessection.prob2})'
|
18
|
40 #end if
|
|
41 #end if
|
|
42
|
72
|
43 groupby="'${plotsum.conditionalgroupby.groupby}'"
|
18
|
44 #if $plotsum.conditionalgroupby.groupby == "test":
|
70
|
45 summaryalpha='${plotsum.conditionalgroupby.testalphaplot}'
|
|
46 only_significant='${plotsum.conditionalgroupby.testonlysig}'
|
18
|
47 #elif $plotsum.conditionalgroupby.groupby == "feature":
|
70
|
48 summaryalpha='${plotsum.conditionalgroupby.featurealphaplot}'
|
|
49 only_significant='${plotsum.conditionalgroupby.featureonlysig}'
|
18
|
50 #end if
|
|
51
|
|
52 >& /dev/null
|
|
53 ]]>
|
|
54 <!--
|
|
55 to print the stack add the following line at the end of the command and enable the corresponding entry in output
|
|
56 2> "${stackerr}"
|
|
57 -->
|
|
58 </command>
|
|
59
|
|
60 <inputs>
|
|
61 <!-- RData -->
|
|
62 <param format="rdata" name="rdata" type="data" label="Select IWTomicsData object" help="File created by 'IWTomics Load Smooth and Plot'." />
|
|
63 <!-- region IDs -->
|
|
64 <param format="tabular" name="regionids" type="data" label="Select region dataset IDs" help="File created by 'IWTomics Load Smooth and Plot'." />
|
|
65 <!-- feature IDs -->
|
|
66 <param format="tabular" name="featureids" type="data" label="Select feature IDs" help="File created by 'IWTomics Load Smooth and Plot'." />
|
|
67
|
|
68 <!-- repeat region ids -->
|
|
69 <section name="regionssection" title="Select regions for Interval-Wise Testing" expanded="True" help="IDs of the region datasets to be tested.">
|
|
70 <repeat name="regions" title="Two-sample test" min="1">
|
|
71 <param name="region0" type="data_column" data_ref="regionids" numerical="False" label="Region 1" multiple="False" use_header_names="True" />
|
|
72 <param name="region1" type="data_column" data_ref="regionids" numerical="False" label="Region 2" multiple="False" use_header_names="True" />
|
|
73 </repeat>
|
|
74 </section>
|
|
75
|
|
76 <!-- feature ids list -->
|
|
77 <param name="featureslist" type="data_column" data_ref="featureids" numerical="False" label="Select features" multiple="True" use_header_names="True" help="IDs of the features to be tested." />
|
|
78
|
|
79 <!-- conditional statistics -->
|
|
80 <conditional name="conditionalstatistics">
|
|
81 <!-- statistics -->
|
|
82 <param name="statistics" type="select" label="Test statistics">
|
|
83 <option value="mean">Mean difference</option>
|
|
84 <option value="median">Median difference</option>
|
|
85 <option value="variance">Variance ratio</option>
|
|
86 <option value="quantile">Quantile difference(s)</option>
|
|
87 </param>
|
|
88 <!-- conditional choice: statistics=quantile -->
|
|
89 <when value="quantile">
|
|
90 <section name="quantilesection" title="Probabilities" expanded="True" help="Probabilities corresponding to the quantiles in test statistics.">
|
|
91 <repeat name="qprobabilities" title="Probabilities" min="1">
|
|
92 <param name="qprob" size="4" type="float" value="0.5" min="0.0" max="1.0" label="Probability" />
|
|
93 </repeat>
|
|
94 </section>
|
|
95 </when>
|
|
96 </conditional>
|
|
97
|
|
98 <!-- permutations -->
|
|
99 <param name="permutations" type="integer" value="1000" min="1" label="Number of permutations" />
|
|
100
|
|
101 <!-- plot IWTomics results -->
|
|
102 <section name="plotres" title="Plot IWTomics test results" expanded="True">
|
|
103 <!-- alpha -->
|
|
104 <param name="alpha" size="3" type="float" value="0.05" min="0.0" max="1.0" label="Level of the test (alpha)" />
|
|
105 <!-- average -->
|
|
106 <param name="average" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Plot the mean curves" />
|
|
107 <!-- average -->
|
|
108 <param name="size" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Plot sample size in each position" />
|
|
109 <!-- conditional plot type -->
|
|
110 <conditional name="conditionalplottype">
|
|
111 <!-- plot type -->
|
|
112 <param name="plottype" type="select" label="Plot type">
|
|
113 <option value="boxplot">Pointwise quantile curves (boxplot)</option>
|
|
114 <option value="curves">Curves (aligned)</option>
|
|
115 </param>
|
|
116 <!-- conditional choice: plottype=boxplot -->
|
|
117 <when value="boxplot">
|
|
118 <section name="probabilitiessection" title="Probabilities" expanded="True" help="Probabilities corresponding to the quantile curves to be drawn.">
|
|
119 <param name="prob0" size="3" type="float" value="0.25" min="0.0" max="1.0" label="Probability" />
|
|
120 <param name="prob1" size="3" type="float" value="0.5" min="0.0" max="1.0" label="Probability" />
|
|
121 <param name="prob2" size="3" type="float" value="0.75" min="0.0" max="1.0" label="Probability" />
|
|
122 <repeat name="probabilities" title="Probabilities">
|
|
123 <param name="prob" size="3" type="float" value="0.5" min="0.0" max="1.0" label="Probability" />
|
|
124 </repeat>
|
|
125 </section>
|
|
126 </when>
|
|
127 </conditional>
|
|
128 </section>
|
|
129
|
|
130 <!-- summary plot -->
|
|
131 <section name="plotsum" title="Summary plot" expanded="True">
|
|
132 <!-- conditional group by -->
|
|
133 <conditional name="conditionalgroupby">
|
|
134 <!-- group by -->
|
|
135 <param name="groupby" type="select" label="Group by" help="How tests should be grouped.">
|
|
136 <option value="none">No plot</option>
|
|
137 <option value="test">Group by test</option>
|
|
138 <option value="feature">Group by feature</option>
|
|
139 </param>
|
|
140 <when value="test">
|
|
141 <param name="testalphaplot" size="3" type="float" value="0.05" min="0.0" max="1.0" label="Level of the test (alpha)" />
|
|
142 <param name="testonlysig" type="boolean" truevalue="TRUE" falsevalue="FALSE" label="Plot only significant tests" />
|
|
143 </when>
|
|
144 <when value="feature">
|
|
145 <param name="featurealphaplot" size="3" type="float" value="0.05" min="0.0" max="1.0" label="Level of the test (alpha)" />
|
|
146 <param name="featureonlysig" type="boolean" truevalue="TRUE" falsevalue="FALSE" label="Plot only significant tests" />
|
|
147 </when>
|
|
148 </conditional>
|
|
149 </section>
|
|
150 </inputs>
|
|
151
|
|
152 <outputs>
|
|
153 <!--<data format="txt" name="stackerr" label="iwtomics.testandplot.stackerr.txt" from_work_dir="iwtomics.testandplot.stackerr.txt" />-->
|
|
154 <data format="txt" name="adjustedpvaluematrix" label="${tool.name} on ${on_string}: Adjusted p-value Matrix" from_work_dir="iwtomics.testandplot.adjustedpvalue.matrix.txt" />
|
|
155 <data format="pdf" name="iwtomicsrespdf" label="${tool.name} on ${on_string}: Plotted Test Results" from_work_dir="iwtomics.testandplot.iwtomicstestresults.pdf" />
|
|
156 <data format="pdf" name="iwtomicssumpdf" label="${tool.name} on ${on_string}: Summary Plot" from_work_dir="iwtomics.testandplot.summaryplot.pdf" />
|
|
157 <data format="rdata" name="iwtomicsrdata" label="${tool.name} on ${on_string}: IWTomicsData Object with Test Results" from_work_dir="iwtomics.testandplot.RData" />
|
|
158 <data format="tabular" name="iwtomicstests" label="${tool.name} on ${on_string}: Test IDs" from_work_dir="iwtomics.testandplot.tests.txt" />
|
|
159 <data format="tabular" name="iwtomicsselectedfeatures" label="${tool.name} on ${on_string}: Feature IDs" from_work_dir="iwtomics.testandplot.selectedfeatures.txt" />
|
|
160 </outputs>
|
|
161
|
56
|
162 <tests>
|
|
163 <test>
|
|
164 <param name="rdata" value="output_loadandplot/iwtomics.loadandplot.RData" ftype="rdata" />
|
|
165 <param name="regionids" value="output_loadandplot/iwtomics.loadandplot.regions.txt" ftype="tabular" />
|
|
166 <param name="featureids" value="output_loadandplot/iwtomics.loadandplot.features.txt" ftype="tabular" />
|
|
167 <repeat name="regions">
|
|
168 <param name="region0" value="2" />
|
|
169 <param name="region1" value="1" />
|
|
170 </repeat>
|
|
171 <repeat name="regions">
|
|
172 <param name="region0" value="3" />
|
|
173 <param name="region1" value="1" />
|
|
174 </repeat>
|
|
175 <repeat name="regions">
|
|
176 <param name="region0" value="4" />
|
|
177 <param name="region1" value="1" />
|
|
178 </repeat>
|
|
179 <param name="featureslist" value="1,2" />
|
|
180 <param name="statistics" value="mean" />
|
|
181 <param name="permutations" value="1000" />
|
|
182 <param name="alpha" value="0.05" />
|
|
183 <param name="average" value="TRUE" />
|
|
184 <param name="size" value="TRUE" />
|
|
185 <param name="plottype" value="boxplot" />
|
|
186 <param name="prob0" value="0.25" />
|
|
187 <param name="prob1" value="0.5" />
|
|
188 <param name="prob2" value="0.75" />
|
|
189 <param name="groupby" value="feature" />
|
|
190 <param name="featurealphaplot" value="0.05" />
|
|
191 <param name="featureonlysig" value="TRUE" />
|
|
192 <output name="adjustedpvaluematrix" file="output_testandplot/iwtomics.testandplot.adjustedpvalue.matrix.txt" compare="sim_size" />
|
|
193 <output name="iwtomicsrespdf" file="output_testandplot/iwtomics.testandplot.iwtomicstestresults.pdf" compare="sim_size" />
|
|
194 <output name="iwtomicssumpdf" file="output_testandplot/iwtomics.testandplot.summaryplot.pdf" compare="sim_size" />
|
|
195 <output name="iwtomicsrdata" file="output_testandplot/iwtomics.testandplot.RData" compare="sim_size" />
|
|
196 <output name="iwtomicstests" file="output_testandplot/iwtomics.testandplot.tests.txt" />
|
|
197 <output name="iwtomicsselectedfeatures" file="output_testandplot/iwtomics.testandplot.selectedfeatures.txt" />
|
|
198 </test>
|
|
199 </tests>
|
|
200
|
68
|
201 <help><![CDATA[
|
18
|
202 This tool statistically evaluates differences in genomic features between groups of regions along the genome.
|
|
203 In particular, it implements the Interval-Wise Testing for omics data, an extended version of the Interval-Wise
|
|
204 Testing for functional data presented in Pini and Vantini (2017). It allows to perform multiple two sample permutation
|
|
205 tests between pairs of region datasets, on several features. It returns the adjusted p-value curves for every test
|
|
206 and all possible scales. Moreover, it creates a graphical representation of the Interval-Wise Testing results
|
|
207 and a summary plot (optional) with p-values at the maximum scale. The tool *IWTomics Plot with Threshold on Test Scale*
|
|
208 permits to select the scale to be used in the plots.
|
|
209
|
|
210 -----
|
|
211
|
|
212 **Input files**
|
|
213
|
|
214 RData file with the IWTomicsData object, tabular files with region dataset IDs and feature IDs.
|
|
215 These files are created by the tool *IWTomics Load Smooth and Plot*.
|
|
216
|
|
217 -----
|
|
218
|
|
219 **Output**
|
|
220
|
|
221 The tool returns:
|
|
222
|
|
223 1. TXT file with an adjusted p-value matrix for every test performed. Each matrix contains a p-value curve (row) for every scale considered in the test;
|
|
224 2. PDF file with the plotted test results;
|
|
225 3. PDF file with the summary plot;
|
|
226 4. RData with the IWTomicsData object with the test results;
|
|
227 5. Test identifiers;
|
|
228 6. Feature identifiers.
|
|
229
|
|
230 4-6 can be used as input of the tool *IWTomics Plot with Threshold on Test Scale*
|
|
231
|
|
232 -----
|
|
233
|
|
234 .. class:: infomark
|
|
235
|
|
236 **Notes**
|
|
237
|
|
238 This Galaxy tool has been developed by Fabio Cumbo (Third University of Rome, Italy) and Marzia A. Cremona (The Pennsylvania State University, USA).
|
|
239
|
|
240 It implements a simplified version of the function *IWTomicsTest*, *plotTest* and *plotSummary* for *IWTomicsData* objects.
|
|
241 The complete version can be found in the *R/Bioconductor* package *IWTomics* (see vignette_).
|
|
242
|
|
243 .. _vignette: https://bioconductor.org/packages/release/bioc/vignettes/IWTomics/inst/doc/IWTomics.pdf
|
68
|
244 ]]></help>
|
18
|
245
|
70
|
246 <expand macro="citations" />
|
18
|
247
|
|
248 </tool>
|