comparison cummerbund_wrapper.xml @ 16:1773e7dc45fe default tip

Uploaded
author cjav
date Wed, 29 Feb 2012 11:33:27 -0500
parents
children
comparison
equal deleted inserted replaced
15:e8a000b406f2 16:1773e7dc45fe
1 <tool id="cummerbund" name="cummeRbund" version="0.0.4">
2
3 <description>R package designed to aid and simplify the task of analyzing Cufflinks RNA-Seq output</description>
4
5 <command interpreter="python">
6 cummerbund_wrapper.py
7 --r-script ${script_file}
8 --html-report-from-directory "${output_html}" "${output_html.files_path}"
9 </command>
10
11 <inputs>
12 <conditional name="backend_database_source">
13 <param name="backend_database_selector" type="select" label="Will you select a backend database file from the history or do you want to build a new one using cuffdiff output?">
14 <option value="history" selected="true">Use backend database from the history</option>
15 <option value="cuffdiff_output">Build backend database using cuffdiff output</option>
16 </param>
17 <when value="cuffdiff_output">
18 <param format="tabular" name="isoforms_fpkm_tracking" type="data" label="Transcript FPKM tracking"/>
19 <param format="tabular" name="isoforms_exp" type="data" label="Transcript differential expression testing"/>
20 <param format="tabular" name="genes_fpkm_tracking" type="data" label="Gene FPKM tracking"/>
21 <param format="tabular" name="genes_exp" type="data" label="Gene differential expression testing"/>
22 <param format="tabular" name="tss_groups_fpkm_tracking" type="data" label="TSS groups FPKM tracking"/>
23 <param format="tabular" name="tss_groups_exp" type="data" label="TSS groups differential expression testing"/>
24 <param format="tabular" name="cds_fpkm_tracking" type="data" label="CDS FPKM tracking"/>
25 <param format="tabular" name="cds_exp_diff" type="data" label="CDS FPKM differential expression testing"/>
26 <param format="tabular" name="cds_diff" type="data" label="CDS overloading diffential expression testing"/>
27 <param format="tabular" name="promoters_diff" type="data" label="Promoters differential expression testing"/>
28 <param format="tabular" name="splicing_diff" type="data" label="Splicing differential expression testing"/>
29 <param name="rebuild" type="hidden" value="TRUE"/>
30 </when>
31 <when value="history">
32 <param name="input_database" type="data" format="data" label="Select backend database (sqlite)"/>
33 </when>
34 </conditional>
35 <repeat name="plots" title="Plots">
36 <param name="width" type="text" value="1280" label="The width of the image"/>
37 <param name="height" type="text" value="960" label="The height of the image"/>
38 <conditional name="plot">
39 <param name="type" type="select" label="Plot type">
40 <option value="density" selected="true">Density</option>
41 <option value="boxplot">Boxplot</option>
42 <option value="scatter">Scatter</option>
43 <option value="volcano">Volcano</option>
44 <option value="heatmap">Heatmap</option>
45 <option value="cluster">Cluster</option>
46 <option value="expressionplot">Expression Plot</option>
47 <option value="expressionbarplot">Expression Bar Plot</option>
48 </param>
49 <when value="density">
50 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/>
51 </when>
52 <when value="boxplot">
53 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/>
54 </when>
55 <when value="scatter">
56 <param name="x" type="text" label="Sample name for x axis"/>
57 <param name="y" type="text" label="Sample name for y axis"/>
58 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/>
59 <param name="smooth" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Add a smooth-fit regression line"/>
60 <conditional name="multiple_genes">
61 <param name="multiple_genes_selector" type="boolean" truevalue="T" falsevalue="F" checked="False" label="Limit plot to a group of genes?"/>
62 <when value="T">
63 <param name="features" type="select" label="Expression levels to plot?">
64 <option value="gene" selected="true">Genes</option>
65 <option value="isoforms">Isoforms</option>
66 <option value="tss">TSS</option>
67 <option value="cds">CDS</option>
68 </param>
69 <repeat name="genes" title="Genes">
70 <param name="gene_id" type="text" label="Gene ID"/>
71 </repeat>
72 </when>
73 <when value="F"/>
74 </conditional>
75 </when>
76 <when value="volcano">
77 <param name="x" type="text" label="First sample name for comparison"/>
78 <param name="y" type="text" label="Second sample name for comparison"/>
79 <conditional name="multiple_genes">
80 <param name="multiple_genes_selector" type="boolean" truevalue="T" falsevalue="F" checked="False" label="Limit plot to a group of genes?"/>
81 <when value="T">
82 <param name="features" type="select" label="Expression levels to plot?">
83 <option value="gene" selected="true">Genes</option>
84 <option value="isoforms">Isoforms</option>
85 <option value="tss">TSS</option>
86 <option value="cds">CDS</option>
87 </param>
88 <repeat name="genes" title="Genes">
89 <param name="gene_id" type="text" label="Gene ID"/>
90 </repeat>
91 </when>
92 <when value="F"/>
93 </conditional>
94 </when>
95 <when value="heatmap">
96 <param name="features" type="select" label="Expression levels to plot?">
97 <option value="gene" selected="true">Genes</option>
98 <option value="isoforms">Isoforms</option>
99 <option value="tss">TSS</option>
100 <option value="cds">CDS</option>
101 </param>
102 <repeat name="genes" title="Genes">
103 <param name="gene_id" type="text" label="Gene ID"/>
104 </repeat>
105 <param name="clustering" type="select" label="Cluster by">
106 <option value="row">Row</option>
107 <option value="column">Column</option>
108 <option value="both" selected="true">Both</option>
109 <option value="none">None</option>
110 </param>
111 <param name="labcol" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Display column labels?"/>
112 <param name="labrow" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Display column labels?"/>
113 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/>
114 <param name="border" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="False" label="Draw border around plot?"/>
115 </when>
116 <when value="cluster">
117 <param name="features" type="select" label="Expression levels to plot?">
118 <option value="gene" selected="true">Genes</option>
119 <option value="isoforms">Isoforms</option>
120 <option value="tss">TSS</option>
121 <option value="cds">CDS</option>
122 </param>
123 <repeat name="genes" title="Genes">
124 <param name="gene_id" type="text" label="Gene ID"/>
125 </repeat>
126 <param name="k" type="text" label="Number of pre-defined clusters to attempt to find."/>
127 <param name="iter_max" type="text" value="100" label="Max iterations"/>
128 </when>
129 <when value="expressionplot">
130 <param name="features" type="select" label="Expression levels to plot?">
131 <option value="gene" selected="true">Genes</option>
132 <option value="isoforms">Isoforms</option>
133 <option value="tss">TSS</option>
134 <option value="cds">CDS</option>
135 </param>
136 <param name="gene_id" type="text" label="Gene ID"/>
137 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/>
138 <param name="draw_summary" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="False" label="Draw a 'summary' line with mean FPKM
139 values for each condition?"/>
140 <param name="show_error_bars" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Draw error bars?"/>
141 </when>
142 <when value="expressionbarplot">
143 <param name="features" type="select" label="Expression levels to plot?">
144 <option value="gene" selected="true">Genes</option>
145 <option value="isoforms">Isoforms</option>
146 <option value="tss">TSS</option>
147 <option value="cds">CDS</option>
148 </param>
149 <param name="gene_id" type="text" label="Gene ID"/>
150 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/>
151 <param name="show_error_bars" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Draw error bars?"/>
152 </when>
153 </conditional>
154 </repeat>
155 </inputs>
156
157 <outputs>
158 <data format="data" name="output_database" label="${tool.name} on ${on_string}: Database File (sqlite)">
159 <filter>backend_database_source['backend_database_selector'] == "cuffdiff_output"</filter>
160 </data>
161 <data format="html" name="output_html" label="${tool.name} on ${on_string} (HTML)"/>
162 </outputs>
163
164 <requirements>
165 <requirement type="binary">R</requirement>
166 </requirements>
167
168 <!-->
169 <tests>
170 <test>
171 <param name="" value=""/>
172 <output name="" file=""/>
173 </test>
174 </tests>
175 -->
176 <configfiles>
177 <configfile name="script_file">
178
179 ## Feature Selection ##
180 get_features &lt;- function(myGenes, f="gene") {
181 if (f == "isoforms")
182 return(isoforms(myGenes))
183 else if (f == "tss")
184 return(TSS(myGenes))
185 else if (f == "cds")
186 return(CDS(myGenes))
187 else
188 return(myGenes)
189 }
190
191 ## Main Function ##
192
193 ## Load cummeRbund library
194 library("cummeRbund")
195
196 ## Initialize cuff object
197 cuff &lt;- readCufflinks(dir = "",
198 #if $backend_database_source.backend_database_selector == "cuffdiff_output":
199 dbFile = "${output_database}",
200 geneFPKM = "${genes_fpkm_tracking}",
201 geneDiff = "${genes_exp}",
202 isoformFPKM = "${isoforms_fpkm_tracking}",
203 isoformDiff = "${isoforms_exp}",
204 TSSFPKM = "${tss_groups_fpkm_tracking}",
205 TSSDiff = "${tss_groups_exp}",
206 CDSFPKM = "${cds_fpkm_tracking}",
207 CDSExpDiff = "${cds_exp_diff}",
208 CDSDiff = "${cds_diff}",
209 promoterFile = "${promoters_diff}",
210 splicingFile = "${splicing_diff}",
211 rebuild = T)
212 #else:
213 dbFile = "${backend_database_source.input_database}",
214 rebuild = F)
215 #end if
216
217 #for $i, $p in enumerate($plots, start=1):
218 #set $filename = "plot%02d-%s.png" % ($i, $p.plot['type'])
219 png(filename = "${filename}", width = ${p.width}, height = ${p.height})
220
221 ## Density plot ##
222 #if $p.plot['type'] == "density":
223 csDensity(genes(cuff))
224 devname = dev.off()
225
226 ## Boxplot ##
227 #elif $p.plot['type'] == "boxplot":
228 csBoxplot(genes(cuff))
229 devname = dev.off()
230
231 ## Scatter ##
232 #elif $p.plot['type'] == "scatter":
233 #if $p.plot.multiple_genes['multiple_genes_selector']:
234 myGeneIds &lt;- c()
235 #for $g in $p.plot.multiple_genes['genes']:
236 myGeneIds &lt;- c(myGeneIds, "$g['gene_id']")
237 #end for
238 myGenes &lt;- getGenes(cuff, myGeneIds)
239 csScatter(get_features(myGenes, "$p.plot.multiple_genes['features']"), "${p.plot.x}", "${p.plot.y}", smooth=${p.plot.smooth})
240 #else
241 csScatter(genes(cuff), "${p.plot.x}", "${p.plot.y}", smooth=${p.plot.smooth})
242 #end if
243 devname = dev.off()
244
245 ## Volcano ##
246 #elif $p.plot['type'] == "volcano":
247 #if $p.plot.multiple_genes['multiple_genes_selector']:
248 myGeneIds &lt;- c()
249 #for $g in $p.plot.multiple_genes['genes']:
250 myGeneIds &lt;- c(myGeneIds, "$g['gene_id']")
251 #end for
252 myGenes &lt;- getGenes(cuff, myGeneIds)
253 csVolcano(get_features(myGenes, "$p.plot.multiple_genes['features']"), "${p.plot.x}", "${p.plot.y}")
254 #else
255 csVolcano(genes(cuff), "${p.plot.x}", "${p.plot.y}")
256 #end if
257 devname = dev.off()
258
259 ## Heatmap ##
260 #elif $p.plot['type'] == "heatmap":
261 myGeneIds &lt;- c()
262 #for $g in $p.plot.genes:
263 myGeneIds &lt;- c(myGeneIds, "$g['gene_id']")
264 #end for
265 myGenes &lt;- getGenes(cuff, myGeneIds)
266 csHeatmap(get_features(myGenes, "${p.plot.features}"), clustering="${p.plot.clustering}", labCol="${p.plot.labcol}", labRow="${p.plot.labrow}", border="${p.plot.border}")
267 devname = dev.off()
268
269 ## Cluster ##
270 #elif $p.plot['type'] == "cluster":
271 myGeneIds &lt;- c()
272 #for $g in $p.plot.genes:
273 myGeneIds &lt;- c(myGeneIds, "$g['gene_id']")
274 #end for
275 myGenes &lt;- getGenes(cuff, myGeneIds)
276 csCluster(get_features(myGenes, "${p.plot.features}"), k=${p.plot.k}, iter.max="${p.plot.iter_max}")
277 devname = dev.off()
278
279 ## Expression Plot ##
280 #elif $p.plot['type'] == "expressionplot":
281 myGeneId &lt;- "$p.plot.gene_id"
282 myGenes &lt;- getGenes(cuff, myGeneId)
283 expressionPlot(get_features(myGenes, "${p.plot.features}"), drawSummary=${p.plot.draw_summary}, iter.max="${p.plot.show_error_bars}")
284 devname = dev.off()
285
286 ## Expression Bar Plot ##
287 #elif $p.plot['type'] == "expressionbarplot":
288 myGeneId &lt;- "$p.plot.gene_id"
289 myGenes &lt;- getGenes(cuff, myGeneId)
290 expressionBarplot(get_features(myGenes, "${p.plot.features}"), iter.max="${p.plot.show_error_bars}")
291 devname = dev.off()
292 #end if
293
294 #end for
295 </configfile>
296 </configfiles>
297
298 <help>
299 This tool allows for persistent storage, access, exploration, and manipulation of Cufflinks high-throughput sequencing data. In addition, provides numerous plotting functions for commonly used visualizations.
300 </help>
301
302 </tool>