annotate cummeRbund.R @ 6:c3b54a4b7741 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
author devteam
date Mon, 06 Jul 2020 20:25:47 -0400
parents 78fcfc04fcfe
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
1 ## Feature Selection ##
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
2 options(echo = TRUE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
3 get_features <- function(my_genes, f = "gene") {
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
4 if (f == "isoforms")
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
5 return(isoforms(my_genes))
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
6 else if (f == "tss")
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
7 return(TSS(my_genes))
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
8 else if (f == "cds")
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
9 return(CDS(my_genes))
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
10 else
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
11 return(my_genes)
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
12 }
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
13
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
14 ## Main Function ##
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
15
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
16 library(argparse)
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
17
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
18 parser <- ArgumentParser(description = "Create a plot with cummeRbund")
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
19
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
20 parser$add_argument("--type", dest = "plotType", default = "Density", required = TRUE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
21 parser$add_argument("--height", dest = "height", type = "integer", default = 960, required = TRUE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
22 parser$add_argument("--width", dest = "width", type = "integer", default = 1280, required = TRUE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
23 parser$add_argument("--outfile", dest = "filename", default = "plot-unknown-0.png", required = TRUE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
24 parser$add_argument("--input", dest = "input_database", default = "cuffData.db", required = TRUE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
25 parser$add_argument("--smooth", dest = "smooth", action = "store_true", default = FALSE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
26 parser$add_argument("--gene_selector", dest = "gene_selector", action = "store_true", default = FALSE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
27 parser$add_argument("--replicates", dest = "replicates", action = "store_true", default = FALSE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
28 parser$add_argument("--labcol", dest = "labcol", action = "store_true", default = FALSE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
29 parser$add_argument("--labrow", dest = "labrow", action = "store_true", default = FALSE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
30 parser$add_argument("--border", dest = "border", action = "store_true", default = FALSE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
31 parser$add_argument("--summary", dest = "summary", action = "store_true", default = FALSE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
32 parser$add_argument("--count", dest = "count", action = "store_true", default = FALSE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
33 parser$add_argument("--error_bars", dest = "error_bars", action = "store_true", default = FALSE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
34 parser$add_argument("--log10", dest = "log10", action = "store_true", default = FALSE)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
35 parser$add_argument("--features", dest = "features", action = "store", default = "genes")
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
36 parser$add_argument("--clustering", dest = "clustering", action = "store", default = "both")
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
37 parser$add_argument("--iter_max", dest = "iter_max", action = "store")
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
38 parser$add_argument("--genes", dest = "genes", action = "append")
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
39 parser$add_argument("--k", dest = "k", action = "store")
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
40 parser$add_argument("--x", dest = "x", action = "store")
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
41 parser$add_argument("--y", dest = "y", action = "store")
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
42
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
43 args <- parser$parse_args()
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
44
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
45 ## Load cummeRbund library
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
46 library("cummeRbund")
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
47
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
48 ## Initialize cuff object
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
49 cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE)
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
50
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
51 ## Print out info
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
52 print(cuff)
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
53 sink("cuffdb_info.txt")
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
54 print(cuff)
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
55 print("SAMPLES:")
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
56 samples(cuff)
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
57 print("REPLICATES:")
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
58 replicates(cuff)
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
59 print("FEATURES:")
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
60 print(annotation(genes(cuff)))
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
61 cat(annotation(genes(cuff))[[1]], sep = ",")
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
62 sink()
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
63
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
64 png(filename = args$filename, width = args$width, height = args$height)
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
65 tryCatch({
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
66 if (args$plotType == "density") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
67 csDensity(genes(cuff), replicates = args$replicates, logMode = args$log10)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
68 } else if (args$plotType == "boxplot") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
69 csBoxplot(genes(cuff), replicates = args$replicates, logMode = args$log10)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
70 } else if (args$plotType == "mds") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
71 MDSplot(genes(cuff), replicates = args$replicates)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
72 } else if (args$plotType == "pca") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
73 PCAplot(genes(cuff), "PC1", "PC2", replicates = args$replicates)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
74 } else if (args$plotType == "dendrogram") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
75 csDendro(genes(cuff), replicates = args$replicates)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
76 } else if (args$plotType == "scatter") {
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
77 if (args$gene_selector) {
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
78 my_genes <- get_features(getGenes(cuff, args$genes), args$features)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
79 } else {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
80 my_genes <- genes(cuff)
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
81 }
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
82 csScatter(my_genes, args$x, args$y, smooth = args$smooth, logMode = args$log10)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
83 } else if (args$plotType == "volcano") {
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
84 if (args$gene_selector) {
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
85 my_genes <- get_features(getGenes(cuff, args$genes), args$features)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
86 } else {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
87 my_genes <- genes(cuff)
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
88 }
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
89 csVolcano(my_genes, args$x, args$y)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
90 } else if (args$plotType == "heatmap") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
91 if (args$gene_selector) {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
92 my_genes <- getGenes(cuff, args$genes)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
93 } else {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
94 my_genes <- getGenes(cuff, annotation(genes(cuff))[[1]])
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
95 }
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
96 csHeatmap(get_features(my_genes, args$features), clustering = args$clustering, labCol = args$labcol, labRow = args$labrow, border = args$border, logMode = args$log10)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
97 } else if (args$plotType == "cluster") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
98 my_genes <- getGenes(cuff, args$genes)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
99 csCluster(get_features(my_genes, args$features), k = args$k)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
100 } else if (args$plotType == "dispersion") {
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
101 dispersionPlot(genes(cuff))
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
102 } else if (args$plotType == "fpkmSCV") {
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
103 fpkmSCVPlot(genes(cuff))
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
104 } else if (args$plotType == "scatterMatrix") {
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
105 csScatterMatrix(genes(cuff))
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
106 } else if (args$plotType == "expressionplot") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
107 my_genes <- getGenes(cuff, args$genes)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
108 expressionPlot(get_features(my_genes, args$features), drawSummary = args$summary, showErrorbars = args$error_bars, replicates = args$replicates)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
109 } else if (args$plotType == "expressionbarplot") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
110 my_gene_id <- args$genes
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
111 my_genes <- getGenes(cuff, my_gene_id)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
112 expressionBarplot(get_features(my_genes, args$features), showErrorbars = args$error_bars, replicates = args$replicates)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
113 } else if (args$plotType == "mds") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
114 MDSplot(genes(cuff), replicates = args$replicates)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
115 } else if (args$plotType == "pca") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
116 PCAplot(genes(cuff), "PC1", "PC2", replicates = args$replicates)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
117 } else if (args$plotType == "maplot") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
118 MAplot(genes(cuff), args$x, args$y, useCount = args$count)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
119 } else if (args$plotType == "genetrack") {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
120 my_gene <- getGene(cuff, args$genes)
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
121 plotTracks(makeGeneRegionTrack(my_gene))
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
122 }
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
123 }, error = function(e) {
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
124 write(paste("Failed:", e, sep = " "), stderr())
0
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
125 q("no", 1, TRUE)
587c425b4e76 Initial commit with version 1.0.0 of the cummeRbund wrapper.
devteam
parents:
diff changeset
126 })
6
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
127 devname <- dev.off()
c3b54a4b7741 "planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit f929353ffb0623f2218d7dec459c7da62f3b0d24"
devteam
parents: 5
diff changeset
128 print("cummeRbund finished")