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