comparison plotwithscale.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="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>
135 <!--<data format="txt" name="stackerr" label="iwtomics.testandplot.stackerr.txt" from_work_dir="iwtomics.testandplot.stackerr.txt" />-->
136 <data format="txt" name="adjustedpvalue" label="${tool.name} on ${on_string}: Adjusted p-value" from_work_dir="iwtomics.testandplot.adjustedpvalue.txt" />
137 <data format="pdf" name="iwtomicsrespdf" label="${tool.name} on ${on_string}: Plotted Test Results" from_work_dir="iwtomics.testandplot.iwtomicstestresults.pdf" />
138 <data format="pdf" name="iwtomicssumpdf" label="${tool.name} on ${on_string}: Summary Plot" from_work_dir="iwtomics.testandplot.summaryplot.pdf" />
139 </outputs>
140
141 <help>
142 This tool allows to select the scale for the Interval-Wise Testing results. In particular, it returns the p-value curves
143 for the different tests performed at the selected scale, and it creates a graphical representation of the
144 Interval-Wise Testing results and a summary plot (optional) at the selected scale.
145
146 -----
147
148 **Input files**
149
150 RData file with the IWTomicsData object with test results, tabular files with test IDs and feature IDs.
151 These files are created by the tool *IWTomics Test and Plot*.
152
153 -----
154
155 **Output**
156
157 The tool returns:
158
159 1. TXT file with an adjusted p-value curve for every test performed at the selected scale;
160 2. PDF file with the plotted test results;
161 3. PDF file with the summary plot.
162
163 -----
164
165 .. class:: infomark
166
167 **Notes**
168
169 This Galaxy tool has been developed by Fabio Cumbo (Third University of Rome, Italy) and Marzia A. Cremona (The Pennsylvania State University, USA).
170
171 It implements a simplified version of the function *IWTomicsTest*, *plotTest* and *plotSummary* for *IWTomicsData* objects.
172 The complete version can be found in the *R/Bioconductor* package *IWTomics* (see vignette_).
173
174 .. _vignette: https://bioconductor.org/packages/release/bioc/vignettes/IWTomics/inst/doc/IWTomics.pdf
175 </help>
176
177 <citations>
178 <citation type="bibtex">
179 @ARTICLE{
180 iwt-functional-data,
181 author = {A Pini and S. Vantini},
182 title = {Interval-Wise Testing for functional data},
183 journal = {Journal of Nonparametric Statistics},
184 year = {2017},
185 volume = {29},
186 number = {2},
187 pages = {407-424}
188 }
189 </citation>
190 <citation type="bibtex">
191 @MANUAL{
192 iwtomics,
193 author = {Cremona, Marzia A and Pini, Alessia and Chiaromonte, Francesca and Vantini, Simone},
194 title = {IWTomics: Interval-Wise Testing for Omics Data},
195 note = {R package version 0.99.12},
196 year = {2017}
197 }
198 </citation>
199 </citations>
200
201 </tool>