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