comparison testandplot.xml @ 18:565118df598a draft

Uploaded 20170531
author fabio
date Wed, 31 May 2017 11:07:22 -0400
parents
children d49031ef33d5
comparison
equal deleted inserted replaced
17:81faa1567178 18:565118df598a
1 <tool id="testandplot" name="IWTomics Test" version="@VERSION@.0">
2 <description>and Plot</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="requirements" />
7 <stdio>
8 <exit_code range="-1" source="both" level="fatal" description="Missing IWTomics package. Please be sure to have it installed before using this tool." />
9 <exit_code range="10" source="both" level="fatal" description="Wrong region ids." />
10 <exit_code range="20" source="both" level="fatal" description="Wrong feature ids." />
11 <exit_code range="30" source="both" level="fatal" description="Same test repeated multiple times." />
12 <exit_code range="40" source="both" level="fatal" description="Testing error." />
13 <regex match="Error" source="both" level="fatal" description="An error has occurred. Please try again." />
14 </stdio>
15
16 <command>
17 <![CDATA[
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}"
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 ] )
25 region1="c(${region1})"
26 region2="c(${region2})"
27
28 features_subset="c(${featureslist})"
29
30 statistics="'${conditionalstatistics.statistics}'"
31 #if $conditionalstatistics.statistics == "quantile":
32 #set probabilities = '","'.join( [ str( $p.qprob ) for $p in $conditionalstatistics.quantilesection.qprobabilities ] )
33 testprobs="c(${probabilities})"
34 #end if
35
36 B="${permutations}"
37
38 testalpha="${plotres.alpha}"
39 average="${plotres.average}"
40 size="${plotres.size}"
41 plottype="'${plotres.conditionalplottype.plottype}'"
42 #if $plotres.conditionalplottype.plottype == 'boxplot':
43 #set probs = '","'.join( [ str( $p.prob ) for $p in $plotres.conditionalplottype.probabilitiessection.probabilities ] )
44 #if $probs != "":
45 probs="c(${plotres.conditionalplottype.probabilitiessection.prob0},${plotres.conditionalplottype.probabilitiessection.prob1},${plotres.conditionalplottype.probabilitiessection.prob2},${probs})"
46 #else:
47 probs="c(${plotres.conditionalplottype.probabilitiessection.prob0},${plotres.conditionalplottype.probabilitiessection.prob1},${plotres.conditionalplottype.probabilitiessection.prob2})"
48 #end if
49 #end if
50
51 groupby="'${plotsum.conditionalgroupby.groupby}'"
52 #if $plotsum.conditionalgroupby.groupby == "test":
53 summaryalpha="${plotsum.conditionalgroupby.testalphaplot}"
54 only_significant="${plotsum.conditionalgroupby.testonlysig}"
55 #elif $plotsum.conditionalgroupby.groupby == "feature":
56 summaryalpha="${plotsum.conditionalgroupby.featurealphaplot}"
57 only_significant="${plotsum.conditionalgroupby.featureonlysig}"
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
170 <help>
171 This tool statistically evaluates differences in genomic features between groups of regions along the genome.
172 In particular, it implements the Interval-Wise Testing for omics data, an extended version of the Interval-Wise
173 Testing for functional data presented in Pini and Vantini (2017). It allows to perform multiple two sample permutation
174 tests between pairs of region datasets, on several features. It returns the adjusted p-value curves for every test
175 and all possible scales. Moreover, it creates a graphical representation of the Interval-Wise Testing results
176 and a summary plot (optional) with p-values at the maximum scale. The tool *IWTomics Plot with Threshold on Test Scale*
177 permits to select the scale to be used in the plots.
178
179 -----
180
181 **Input files**
182
183 RData file with the IWTomicsData object, tabular files with region dataset IDs and feature IDs.
184 These files are created by the tool *IWTomics Load Smooth and Plot*.
185
186 -----
187
188 **Output**
189
190 The tool returns:
191
192 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;
193 2. PDF file with the plotted test results;
194 3. PDF file with the summary plot;
195 4. RData with the IWTomicsData object with the test results;
196 5. Test identifiers;
197 6. Feature identifiers.
198
199 4-6 can be used as input of the tool *IWTomics Plot with Threshold on Test Scale*
200
201 -----
202
203 .. class:: infomark
204
205 **Notes**
206
207 This Galaxy tool has been developed by Fabio Cumbo (Third University of Rome, Italy) and Marzia A. Cremona (The Pennsylvania State University, USA).
208
209 It implements a simplified version of the function *IWTomicsTest*, *plotTest* and *plotSummary* for *IWTomicsData* objects.
210 The complete version can be found in the *R/Bioconductor* package *IWTomics* (see vignette_).
211
212 .. _vignette: https://bioconductor.org/packages/release/bioc/vignettes/IWTomics/inst/doc/IWTomics.pdf
213 </help>
214
215 <citations>
216 <citation type="bibtex">
217 @ARTICLE{
218 iwt-functional-data,
219 author = {A Pini and S. Vantini},
220 title = {Interval-Wise Testing for functional data},
221 journal = {Journal of Nonparametric Statistics},
222 year = {2017},
223 volume = {29},
224 number = {2},
225 pages = {407-424}
226 }
227 </citation>
228 <citation type="bibtex">
229 @MANUAL{
230 iwtomics,
231 author = {Cremona, Marzia A and Pini, Alessia and Chiaromonte, Francesca and Vantini, Simone},
232 title = {IWTomics: Interval-Wise Testing for Omics Data},
233 note = {R package version 0.99.12},
234 year = {2017}
235 }
236 </citation>
237 </citations>
238
239 </tool>