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