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