annotate volcanoplot.R @ 1:7b7303fa20e3 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
author iuc
date Sat, 29 Dec 2018 13:21:24 -0500
parents 59ebf2c42c0e
children d1d39c72b755
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
1 # setup R error handling to go to stderr
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
2 options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
3
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
4 # we need that to not crash galaxy with an UTF8 error on German LC settings.
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
5 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
6
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
7 suppressPackageStartupMessages({
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
8 library(dplyr)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
9 library(getopt)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
10 library(ggplot2)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
11 library(ggrepel)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
12 })
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
13
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
14 options(stringAsFactors = FALSE, useFancyQuotes = FALSE)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
15 args <- commandArgs(trailingOnly = TRUE)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
16
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
17 spec <- matrix(c(
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
18 "input", "i", 1, "character",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
19 "fdr_col", "a", 1, "integer",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
20 "pval_col", "p", 1, "integer",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
21 "lfc_col", "c", 1, "integer",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
22 "label_col", "l", 1, "integer",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
23 "signif_thresh", "s", 1, "double",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
24 "lfc_thresh", "x", 1, "double",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
25 "label_file", "f", 1, "character",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
26 "top_num", "t", 1, "integer",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
27 "title", "T", 1, "character",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
28 "xlab", "X", 1, "character",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
29 "ylab", "Y", 1, "character",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
30 "legend", "L", 1, "character",
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
31 "llabs", "z", 1, "character"),
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
32 byrow=TRUE, ncol=4)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
33 opt <- getopt(spec)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
34
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
35 # Below modified from http://www.gettinggeneticsdone.com/2016/01/repel-overlapping-text-labels-in-ggplot2.html
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
36
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
37 results <- read.delim(opt$input)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
38 results$fdr <- results[, opt$fdr_col]
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
39 results$Pvalue <- results[, opt$pval_col]
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
40 results$logFC <- results[, opt$lfc_col]
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
41 results$labels <- results[, opt$label_col]
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
42 label_down <- unlist(strsplit(opt$llabs, split=","))[1]
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
43 label_notsig <- unlist(strsplit(opt$llabs, split=","))[2]
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
44 label_up <- unlist(strsplit(opt$llabs, split=","))[3]
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
45 colours <- setNames(c("cornflowerblue","grey","firebrick"),c(label_down,label_notsig,label_up))
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
46
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
47 results <- mutate(results, sig=ifelse((fdr<opt$signif_thresh & logFC>opt$lfc_thresh), label_up, ifelse((fdr<opt$signif_thresh & logFC < -opt$lfc_thresh),label_down, label_notsig)))
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
48 results <- results[order(results$Pvalue),]
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
49 if (!is.null(opt$label_file)) {
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
50 labelfile <- read.delim(opt$label_file)
1
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
51 # label genes specified in file
0
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
52 tolabel <- filter(results, labels %in% labelfile[, 1])
1
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
53 } else if (is.null(opt$top_num)) {
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
54 # label all significant genes
0
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
55 tolabel <- filter(results, fdr<opt$signif_thresh)
1
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
56 } else if (opt$top_num > 0) {
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
57 # label only top significant genes
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
58 tolabel <- filter(results, fdr<opt$signif_thresh) %>%
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
59 top_n(n=opt$top_num, Pvalue)
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
60 } else if (opt$top_num == 0) {
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
61 # no labels
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
62 tolabel <- NULL
0
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
63 }
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
64
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
65 pdf("out.pdf")
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
66 p <- ggplot(results, aes(logFC, -log10(Pvalue))) +
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
67 geom_point(aes(col=sig)) +
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
68 scale_color_manual(values=colours) +
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
69 scale_fill_manual(values=colours) +
1
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
70 theme(panel.grid.major = element_blank(),
0
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
71 panel.grid.minor = element_blank(),
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
72 panel.background = element_blank(),
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
73 axis.line = element_line(colour = "black"),
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
74 legend.key=element_blank())
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
75 if (!is.null(opt$title)) {
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
76 p <- p + ggtitle(opt$title)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
77 }
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
78 if (!is.null(opt$xlab)) {
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
79 p <- p + xlab(opt$xlab)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
80 }
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
81 if (!is.null(opt$ylab)) {
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
82 p <- p + ylab(opt$ylab)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
83 }
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
84 if (!is.null(opt$legend)) {
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
85 p <- p + labs(colour=opt$legend)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
86 } else {
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
87 p <- p + labs(colour="")
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
88 }
1
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
89 if (!is.null(tolabel)) {
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
90 p <- p + geom_label_repel(data=tolabel, aes(label=labels, fill=factor(sig)), colour="white", segment.colour="black", show.legend=FALSE)
7b7303fa20e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed
iuc
parents: 0
diff changeset
91 }
0
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
92
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
93 print(p)
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
94 dev.off()
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
95
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
96 cat("Session information:\n\n")
59ebf2c42c0e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
iuc
parents:
diff changeset
97 sessionInfo()