Mercurial > repos > jjohnson > cummerbund
comparison cummerbund_wrapper.xml @ 8:b0d11fcbc3ac
cummerbund add MDS and PCA plots, handle errors from R
| author | Jim Johnson <jj@umn.edu> |
|---|---|
| date | Thu, 11 Oct 2012 15:14:51 -0500 |
| parents | 9d25b0fd882b |
| children | b6427cdbf6d4 |
comparison
equal
deleted
inserted
replaced
| 7:c2b922c9d545 | 8:b0d11fcbc3ac |
|---|---|
| 46 <option value="volcano">Volcano</option> | 46 <option value="volcano">Volcano</option> |
| 47 <option value="heatmap">Heatmap</option> | 47 <option value="heatmap">Heatmap</option> |
| 48 <option value="cluster">Cluster</option> | 48 <option value="cluster">Cluster</option> |
| 49 <option value="expressionplot">Expression Plot</option> | 49 <option value="expressionplot">Expression Plot</option> |
| 50 <option value="expressionbarplot">Expression Bar 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> | |
| 51 </param> | 53 </param> |
| 52 <when value="density"> | 54 <when value="density"> |
| 53 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/> | 55 <param name="log_mode" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Apply log10 transformation on FPKM values?"/> |
| 54 <param name="replicates" type="boolean" truevalue="T" falsevalue="F" checked="False" label="Replicates?"/> | 56 <param name="replicates" type="boolean" truevalue="T" falsevalue="F" checked="False" label="Replicates?"/> |
| 57 </when> | |
| 58 <when value="mds"> | |
| 59 <param name="replicates" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Replicates?"/> | |
| 60 </when> | |
| 61 <when value="pca"> | |
| 62 <param name="replicates" type="boolean" truevalue="T" falsevalue="F" checked="True" label="Replicates?"/> | |
| 55 </when> | 63 </when> |
| 56 <when value="dispersion"> | 64 <when value="dispersion"> |
| 57 </when> | 65 </when> |
| 58 <when value="fpkmSCV"> | 66 <when value="fpkmSCV"> |
| 59 </when> | 67 </when> |
| 161 <param name="show_error_bars" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Draw error bars?"/> | 169 <param name="show_error_bars" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="True" label="Draw error bars?"/> |
| 162 </when> | 170 </when> |
| 163 </conditional> | 171 </conditional> |
| 164 </repeat> | 172 </repeat> |
| 165 </inputs> | 173 </inputs> |
| 166 | 174 <stdio> |
| 175 <exit_code range="1:" level="fatal" description="CummerBund Error" /> | |
| 176 </stdio> | |
| 167 <outputs> | 177 <outputs> |
| 168 <data format="data" name="output_database" label="${tool.name} on ${on_string}: Database File (sqlite)"> | 178 <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> | 179 <filter>backend_database_source['backend_database_selector'] == "cuffdiff_output"</filter> |
| 170 </data> | 180 </data> |
| 171 <data format="html" name="output_html" label="${tool.name} on ${on_string} (HTML)"/> | 181 <data format="html" name="output_html" label="${tool.name} on ${on_string} (HTML)"/> |
| 225 #end if | 235 #end if |
| 226 | 236 |
| 227 #for $i, $p in enumerate($plots, start=1): | 237 #for $i, $p in enumerate($plots, start=1): |
| 228 #set $filename = "plot%02d-%s.png" % ($i, $p.plot['type']) | 238 #set $filename = "plot%02d-%s.png" % ($i, $p.plot['type']) |
| 229 png(filename = "${filename}", width = ${p.width}, height = ${p.height}) | 239 png(filename = "${filename}", width = ${p.width}, height = ${p.height}) |
| 230 | 240 tryCatch({ |
| 231 ## Density plot ## | 241 ## Density plot ## |
| 232 #if $p.plot['type'] == "density": | 242 #if $p.plot['type'] == "density": |
| 233 csDensity(genes(cuff),replicates=$p.plot.replicates) | 243 csDensity(genes(cuff),replicates=$p.plot.replicates) |
| 234 devname = dev.off() | |
| 235 | 244 |
| 236 ## Dispersion plot ## | 245 ## Dispersion plot ## |
| 237 #elif $p.plot['type'] == "dispersion": | 246 #elif $p.plot['type'] == "dispersion": |
| 238 dispersionPlot(genes(cuff)) | 247 dispersionPlot(genes(cuff)) |
| 239 devname = dev.off() | |
| 240 | 248 |
| 241 ## Squared Coefficient of Variation plot ## | 249 ## Squared Coefficient of Variation plot ## |
| 242 #elif $p.plot['type'] == "fpkmSCV": | 250 #elif $p.plot['type'] == "fpkmSCV": |
| 243 fpkmSCVPlot(genes(cuff)) | 251 fpkmSCVPlot(genes(cuff)) |
| 244 devname = dev.off() | |
| 245 | 252 |
| 246 ## Scatter Matrix ## | 253 ## Scatter Matrix ## |
| 247 #elif $p.plot['type'] == "scatterMatrix": | 254 #elif $p.plot['type'] == "scatterMatrix": |
| 248 csScatterMatrix(genes(cuff)) | 255 csScatterMatrix(genes(cuff)) |
| 249 devname = dev.off() | |
| 250 | 256 |
| 251 ## Boxplot ## | 257 ## Boxplot ## |
| 252 #elif $p.plot['type'] == "boxplot": | 258 #elif $p.plot['type'] == "boxplot": |
| 253 csBoxplot(genes(cuff)) | 259 csBoxplot(genes(cuff)) |
| 254 devname = dev.off() | |
| 255 | 260 |
| 256 ## Scatter ## | 261 ## Scatter ## |
| 257 #elif $p.plot['type'] == "scatter": | 262 #elif $p.plot['type'] == "scatter": |
| 258 #if $p.plot.multiple_genes['multiple_genes_selector']: | 263 #if $p.plot.multiple_genes['multiple_genes_selector']: |
| 259 myGeneIds <- c() | 264 myGeneIds <- c() |
| 263 myGenes <- getGenes(cuff, myGeneIds) | 268 myGenes <- getGenes(cuff, myGeneIds) |
| 264 csScatter(get_features(myGenes, "$p.plot.multiple_genes['features']"), "${p.plot.x}", "${p.plot.y}", smooth=${p.plot.smooth}) | 269 csScatter(get_features(myGenes, "$p.plot.multiple_genes['features']"), "${p.plot.x}", "${p.plot.y}", smooth=${p.plot.smooth}) |
| 265 #else | 270 #else |
| 266 csScatter(genes(cuff), "${p.plot.x}", "${p.plot.y}", smooth=${p.plot.smooth}) | 271 csScatter(genes(cuff), "${p.plot.x}", "${p.plot.y}", smooth=${p.plot.smooth}) |
| 267 #end if | 272 #end if |
| 268 devname = dev.off() | |
| 269 | 273 |
| 270 ## Volcano ## | 274 ## Volcano ## |
| 271 #elif $p.plot['type'] == "volcano": | 275 #elif $p.plot['type'] == "volcano": |
| 272 #if $p.plot.multiple_genes['multiple_genes_selector']: | 276 #if $p.plot.multiple_genes['multiple_genes_selector']: |
| 273 myGeneIds <- c() | 277 myGeneIds <- c() |
| 277 myGenes <- getGenes(cuff, myGeneIds) | 281 myGenes <- getGenes(cuff, myGeneIds) |
| 278 csVolcano(get_features(myGenes, "$p.plot.multiple_genes['features']"), "${p.plot.x}", "${p.plot.y}") | 282 csVolcano(get_features(myGenes, "$p.plot.multiple_genes['features']"), "${p.plot.x}", "${p.plot.y}") |
| 279 #else | 283 #else |
| 280 csVolcano(genes(cuff), "${p.plot.x}", "${p.plot.y}") | 284 csVolcano(genes(cuff), "${p.plot.x}", "${p.plot.y}") |
| 281 #end if | 285 #end if |
| 282 devname = dev.off() | |
| 283 | 286 |
| 284 ## Heatmap ## | 287 ## Heatmap ## |
| 285 #elif $p.plot['type'] == "heatmap": | 288 #elif $p.plot['type'] == "heatmap": |
| 286 myGeneIds <- c() | 289 myGeneIds <- c() |
| 287 #for $g in $p.plot.genes: | 290 #for $g in $p.plot.genes: |
| 288 myGeneIds <- c(myGeneIds, "$g['gene_id']") | 291 myGeneIds <- c(myGeneIds, "$g['gene_id']") |
| 289 #end for | 292 #end for |
| 290 myGenes <- getGenes(cuff, myGeneIds) | 293 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}") | 294 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 | 295 |
| 294 ## Cluster ## | 296 ## Cluster ## |
| 295 #elif $p.plot['type'] == "cluster": | 297 #elif $p.plot['type'] == "cluster": |
| 296 myGeneIds <- c() | 298 myGeneIds <- c() |
| 297 #for $g in $p.plot.genes: | 299 #for $g in $p.plot.genes: |
| 298 myGeneIds <- c(myGeneIds, "$g['gene_id']") | 300 myGeneIds <- c(myGeneIds, "$g['gene_id']") |
| 299 #end for | 301 #end for |
| 300 myGenes <- getGenes(cuff, myGeneIds) | 302 myGenes <- getGenes(cuff, myGeneIds) |
| 301 csCluster(get_features(myGenes, "${p.plot.features}"), k=${p.plot.k}, iter.max="${p.plot.iter_max}") | 303 csCluster(get_features(myGenes, "${p.plot.features}"), k=${p.plot.k}, iter.max="${p.plot.iter_max}") |
| 302 devname = dev.off() | |
| 303 | 304 |
| 304 ## Expression Plot ## | 305 ## Expression Plot ## |
| 305 #elif $p.plot['type'] == "expressionplot": | 306 #elif $p.plot['type'] == "expressionplot": |
| 306 myGeneId <- "$p.plot.gene_id" | 307 myGeneId <- "$p.plot.gene_id" |
| 307 myGenes <- getGenes(cuff, myGeneId) | 308 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 expressionPlot(get_features(myGenes, "${p.plot.features}"), drawSummary=${p.plot.draw_summary}, iter.max="${p.plot.show_error_bars}") |
| 309 devname = dev.off() | |
| 310 | 310 |
| 311 ## Expression Bar Plot ## | 311 ## Expression Bar Plot ## |
| 312 #elif $p.plot['type'] == "expressionbarplot": | 312 #elif $p.plot['type'] == "expressionbarplot": |
| 313 myGeneId <- "$p.plot.gene_id" | 313 myGeneId <- "$p.plot.gene_id" |
| 314 myGenes <- getGenes(cuff, myGeneId) | 314 myGenes <- getGenes(cuff, myGeneId) |
| 315 expressionBarplot(get_features(myGenes, "${p.plot.features}"), iter.max="${p.plot.show_error_bars}") | 315 expressionBarplot(get_features(myGenes, "${p.plot.features}"), iter.max="${p.plot.show_error_bars}") |
| 316 | |
| 317 ## MDS plot ## | |
| 318 #elif $p.plot['type'] == "mds": | |
| 319 MDSplot(genes(cuff),replicates=$p.plot.replicates) | |
| 320 | |
| 321 ## PCA plot ## | |
| 322 #elif $p.plot['type'] == "pca": | |
| 323 PCAplot(genes(cuff),"PC1","PC2",replicates=$p.plot.replicates) | |
| 324 #end if | |
| 325 | |
| 326 },error = function(e) {paste("$p.plot['type'] failed: ", e)}) | |
| 316 devname = dev.off() | 327 devname = dev.off() |
| 317 #end if | |
| 318 | 328 |
| 319 #end for | 329 #end for |
| 320 </configfile> | 330 </configfile> |
| 321 </configfiles> | 331 </configfiles> |
| 322 | 332 |
