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