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