comparison cummerbund_wrapper.xml @ 0:da7241f92ecf

Uploaded
author jjohnson
date Mon, 04 Feb 2013 19:50:25 -0500
parents
children fdf01b3c1841
comparison
equal deleted inserted replaced
-1:000000000000 0:da7241f92ecf
1 <tool id="cummerbund" name="cummeRbund" version="0.0.6">
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="cuffdatadb" 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="dispersion">Dispersion</option>
42 <option value="fpkmSCV">Squared Coefficient of Variation</option>
43 <option value="scatterMatrix">Scatter Matrix</option>
44 <option value="boxplot">Boxplot</option>
45 <option value="scatter">Scatter</option>
46 <option value="volcano">Volcano</option>
47 <option value="heatmap">Heatmap</option>
48 <option value="cluster">Cluster</option>
49 <option value="expressionplot">Expression Plot</option>
50 <option value="expressionbarplot">Expression Bar Plot</option>
51 <option value="mds">MultiDimentional Scaling (MDS) Plot</option>
52 <option value="pca">Principal Component Analysis (PCA) Plot</option>
53 <option value="maplot">Intensity vs Fold-change (MvaA) Plot</option>
54 <option value="dendrogram">Dendrogram</option>
55 </param>
56 <when value="density">
57 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/>
58 <param name="replicates" type="boolean" truevalue="T" falsevalue="F" checked="False" label="Replicates?"/>
59 </when>
60 <when value="mds">
61 <param name="replicates" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Replicates?"/>
62 </when>
63 <when value="pca">
64 <param name="replicates" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Replicates?"/>
65 </when>
66 <when value="maplot">
67 <param name="x" type="text" label="Sample name 1"/>
68 <param name="y" type="text" label="Sample name 2"/>
69 <param name="use_count" type="boolean" truevalue="T" falsevalue="F" checked="False" label="Use Count?"/>
70 </when>
71 <when value="dendrogram">
72 <param name="replicates" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Replicates?"/>
73 </when>
74 <when value="dispersion">
75 </when>
76 <when value="fpkmSCV">
77 </when>
78 <when value="scatterMatrix">
79 </when>
80 <when value="boxplot">
81 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/>
82 </when>
83 <when value="scatter">
84 <param name="x" type="text" label="Sample name for x axis"/>
85 <param name="y" type="text" label="Sample name for y axis"/>
86 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/>
87 <param name="smooth" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Add a smooth-fit regression line"/>
88 <conditional name="multiple_genes">
89 <param name="multiple_genes_selector" type="boolean" truevalue="T" falsevalue="F" checked="False" label="Limit plot to a group of genes?"/>
90 <when value="T">
91 <param name="features" type="select" label="Expression levels to plot?">
92 <option value="gene" selected="true">Genes</option>
93 <option value="isoforms">Isoforms</option>
94 <option value="tss">TSS</option>
95 <option value="cds">CDS</option>
96 </param>
97 <repeat name="genes" title="Genes">
98 <param name="gene_id" type="text" label="Gene ID"/>
99 </repeat>
100 </when>
101 <when value="F"/>
102 </conditional>
103 </when>
104 <when value="volcano">
105 <param name="x" type="text" label="First sample name for comparison"/>
106 <param name="y" type="text" label="Second sample name for comparison"/>
107 <conditional name="multiple_genes">
108 <param name="multiple_genes_selector" type="boolean" truevalue="T" falsevalue="F" checked="False" label="Limit plot to a group of genes?"/>
109 <when value="T">
110 <param name="features" type="select" label="Expression levels to plot?">
111 <option value="gene" selected="true">Genes</option>
112 <option value="isoforms">Isoforms</option>
113 <option value="tss">TSS</option>
114 <option value="cds">CDS</option>
115 </param>
116 <repeat name="genes" title="Genes">
117 <param name="gene_id" type="text" label="Gene ID"/>
118 </repeat>
119 </when>
120 <when value="F"/>
121 </conditional>
122 </when>
123 <when value="heatmap">
124 <param name="features" type="select" label="Expression levels to plot?">
125 <option value="gene" selected="true">Genes</option>
126 <option value="isoforms">Isoforms</option>
127 <option value="tss">TSS</option>
128 <option value="cds">CDS</option>
129 </param>
130 <repeat name="genes" title="Genes">
131 <param name="gene_id" type="text" label="Gene ID"/>
132 </repeat>
133 <param name="clustering" type="select" label="Cluster by">
134 <option value="row">Row</option>
135 <option value="column">Column</option>
136 <option value="both" selected="true">Both</option>
137 <option value="none">None</option>
138 </param>
139 <param name="labcol" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Display column labels?"/>
140 <param name="labrow" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Display column labels?"/>
141 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/>
142 <param name="border" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="False" label="Draw border around plot?"/>
143 </when>
144 <when value="cluster">
145 <param name="features" type="select" label="Expression levels to plot?">
146 <option value="gene" selected="true">Genes</option>
147 <option value="isoforms">Isoforms</option>
148 <option value="tss">TSS</option>
149 <option value="cds">CDS</option>
150 </param>
151 <repeat name="genes" title="Genes">
152 <param name="gene_id" type="text" label="Gene ID"/>
153 </repeat>
154 <param name="k" type="text" label="Number of pre-defined clusters to attempt to find."/>
155 <param name="iter_max" type="text" value="100" label="Max iterations"/>
156 </when>
157 <when value="expressionplot">
158 <param name="features" type="select" label="Expression levels to plot?">
159 <option value="gene" selected="true">Genes</option>
160 <option value="isoforms">Isoforms</option>
161 <option value="tss">TSS</option>
162 <option value="cds">CDS</option>
163 </param>
164 <param name="gene_id" type="text" label="Gene ID"/>
165 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/>
166 <param name="draw_summary" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="False" label="Draw a 'summary' line with mean FPKM
167 values for each condition?"/>
168 <param name="show_error_bars" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Draw error bars?"/>
169 </when>
170 <when value="expressionbarplot">
171 <param name="features" type="select" label="Expression levels to plot?">
172 <option value="gene" selected="true">Genes</option>
173 <option value="isoforms">Isoforms</option>
174 <option value="tss">TSS</option>
175 <option value="cds">CDS</option>
176 </param>
177 <param name="gene_id" type="text" label="Gene ID"/>
178 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/>
179 <param name="show_error_bars" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Draw error bars?"/>
180 </when>
181 </conditional>
182 </repeat>
183 </inputs>
184 <stdio>
185 <exit_code range="1:" level="fatal" description="CummerBund Error" />
186 </stdio>
187 <outputs>
188 <data format="data" name="output_database" label="${tool.name} on ${on_string}: Database File (sqlite)">
189 <filter>backend_database_source['backend_database_selector'] == "cuffdiff_output"</filter>
190 </data>
191 <data format="html" name="output_html" label="${tool.name} on ${on_string} (HTML)"/>
192 </outputs>
193
194 <requirements>
195 <requirement type="binary">R</requirement>
196 </requirements>
197
198 <!-->
199 <tests>
200 <test>
201 <param name="" value=""/>
202 <output name="" file=""/>
203 </test>
204 </tests>
205 -->
206 <configfiles>
207 <configfile name="script_file">
208
209 ## Feature Selection ##
210 get_features &lt;- function(myGenes, f="gene") {
211 if (f == "isoforms")
212 return(isoforms(myGenes))
213 else if (f == "tss")
214 return(TSS(myGenes))
215 else if (f == "cds")
216 return(CDS(myGenes))
217 else
218 return(myGenes)
219 }
220
221 ## Main Function ##
222
223 ## Load cummeRbund library
224 library("cummeRbund")
225
226 ## Initialize cuff object
227 cuff &lt;- readCufflinks(dir = "",
228 #if $backend_database_source.backend_database_selector == "cuffdiff_output":
229 dbFile = "${output_database}",
230 geneFPKM = "${genes_fpkm_tracking}",
231 geneDiff = "${genes_exp}",
232 isoformFPKM = "${isoforms_fpkm_tracking}",
233 isoformDiff = "${isoforms_exp}",
234 TSSFPKM = "${tss_groups_fpkm_tracking}",
235 TSSDiff = "${tss_groups_exp}",
236 CDSFPKM = "${cds_fpkm_tracking}",
237 CDSExpDiff = "${cds_exp_diff}",
238 CDSDiff = "${cds_diff}",
239 promoterFile = "${promoters_diff}",
240 splicingFile = "${splicing_diff}",
241 rebuild = T)
242 #else:
243 dbFile = "${backend_database_source.input_database}",
244 rebuild = F)
245 #end if
246
247 #for $i, $p in enumerate($plots, start=1):
248 #set $filename = "plot%02d-%s.png" % ($i, $p.plot['type'])
249 png(filename = "${filename}", width = ${p.width}, height = ${p.height})
250 tryCatch({
251 ## Density plot ##
252 #if $p.plot['type'] == "density":
253 csDensity(genes(cuff),replicates=$p.plot.replicates)
254
255 ## Dispersion plot ##
256 #elif $p.plot['type'] == "dispersion":
257 dispersionPlot(genes(cuff))
258
259 ## Squared Coefficient of Variation plot ##
260 #elif $p.plot['type'] == "fpkmSCV":
261 fpkmSCVPlot(genes(cuff))
262
263 ## Scatter Matrix ##
264 #elif $p.plot['type'] == "scatterMatrix":
265 csScatterMatrix(genes(cuff))
266
267 ## Boxplot ##
268 #elif $p.plot['type'] == "boxplot":
269 csBoxplot(genes(cuff))
270
271 ## Scatter ##
272 #elif $p.plot['type'] == "scatter":
273 #if $p.plot.multiple_genes['multiple_genes_selector']:
274 myGeneIds &lt;- c()
275 #for $g in $p.plot.multiple_genes['genes']:
276 myGeneIds &lt;- c(myGeneIds, "$g['gene_id']")
277 #end for
278 myGenes &lt;- getGenes(cuff, myGeneIds)
279 csScatter(get_features(myGenes, "$p.plot.multiple_genes['features']"), "${p.plot.x}", "${p.plot.y}", smooth=${p.plot.smooth})
280 #else
281 csScatter(genes(cuff), "${p.plot.x}", "${p.plot.y}", smooth=${p.plot.smooth})
282 #end if
283
284 ## Volcano ##
285 #elif $p.plot['type'] == "volcano":
286 #if $p.plot.multiple_genes['multiple_genes_selector']:
287 myGeneIds &lt;- c()
288 #for $g in $p.plot.multiple_genes['genes']:
289 myGeneIds &lt;- c(myGeneIds, "$g['gene_id']")
290 #end for
291 myGenes &lt;- getGenes(cuff, myGeneIds)
292 csVolcano(get_features(myGenes, "$p.plot.multiple_genes['features']"), "${p.plot.x}", "${p.plot.y}")
293 #else
294 csVolcano(genes(cuff), "${p.plot.x}", "${p.plot.y}")
295 #end if
296
297 ## Heatmap ##
298 #elif $p.plot['type'] == "heatmap":
299 myGeneIds &lt;- c()
300 #for $g in $p.plot.genes:
301 myGeneIds &lt;- c(myGeneIds, "$g['gene_id']")
302 #end for
303 myGenes &lt;- getGenes(cuff, myGeneIds)
304 csHeatmap(get_features(myGenes, "${p.plot.features}"), clustering="${p.plot.clustering}", labCol="${p.plot.labcol}", labRow="${p.plot.labrow}", border="${p.plot.border}")
305
306 ## Cluster ##
307 #elif $p.plot['type'] == "cluster":
308 myGeneIds &lt;- c()
309 #for $g in $p.plot.genes:
310 myGeneIds &lt;- c(myGeneIds, "$g['gene_id']")
311 #end for
312 myGenes &lt;- getGenes(cuff, myGeneIds)
313 csCluster(get_features(myGenes, "${p.plot.features}"), k=${p.plot.k}, iter.max="${p.plot.iter_max}")
314
315 ## Expression Plot ##
316 #elif $p.plot['type'] == "expressionplot":
317 myGeneId &lt;- "$p.plot.gene_id"
318 myGenes &lt;- getGenes(cuff, myGeneId)
319 expressionPlot(get_features(myGenes, "${p.plot.features}"), drawSummary=${p.plot.draw_summary}, iter.max="${p.plot.show_error_bars}")
320
321 ## Expression Bar Plot ##
322 #elif $p.plot['type'] == "expressionbarplot":
323 myGeneId &lt;- "$p.plot.gene_id"
324 myGenes &lt;- getGenes(cuff, myGeneId)
325 expressionBarplot(get_features(myGenes, "${p.plot.features}"), iter.max="${p.plot.show_error_bars}")
326
327 ## MDS plot ##
328 #elif $p.plot['type'] == "mds":
329 MDSplot(genes(cuff),replicates=$p.plot.replicates)
330
331 ## PCA plot ##
332 #elif $p.plot['type'] == "pca":
333 PCAplot(genes(cuff),"PC1","PC2",replicates=$p.plot.replicates)
334
335 ## MAplot plot ##
336 #elif $p.plot['type'] == "maplot":
337 MAplot(genes(cuff), "${p.plot.x}", "${p.plot.y}", useCount=${p.plot.use_count})
338
339 ## Dendogram plot ##
340 #elif $p.plot['type'] == "dendrogram":
341 csDendro(genes(cuff),replicates=$p.plot.replicates)
342 #end if
343
344 },error = function(e) {paste("$p.plot['type'] failed: ", e)})
345 devname = dev.off()
346
347 #end for
348 </configfile>
349 </configfiles>
350
351 <help>
352 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.
353 </help>
354
355 </tool>