annotate cummeRbund.R @ 0:e462121e8269 draft

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