Mercurial > repos > iuc > dexseq
comparison plotdexseq.R @ 7:62adf13b86ea draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/dexseq commit 06f2c57b523aab7c997d82e1345fd23f178de598"
author | iuc |
---|---|
date | Fri, 19 Mar 2021 09:45:03 +0000 |
parents | 278b189248cd |
children | df929f257179 |
comparison
equal
deleted
inserted
replaced
6:9fd8b69e6e68 | 7:62adf13b86ea |
---|---|
1 ## Setup R error handling to go to stderr | 1 ## Setup R error handling to go to stderr |
2 options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) | 2 options(show.error.messages = F, error = function() { |
3 cat(geterrmessage(), file = stderr()); q("no", 1, F) | |
4 }) | |
3 # we need that to not crash galaxy with an UTF8 error on German LC settings. | 5 # we need that to not crash galaxy with an UTF8 error on German LC settings. |
4 Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") | 6 Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") |
5 | 7 |
6 suppressPackageStartupMessages({ | 8 suppressPackageStartupMessages({ |
7 library("DEXSeq") | 9 library("DEXSeq") |
8 library('getopt') | 10 library("getopt") |
9 }) | 11 }) |
10 | 12 |
11 options(stringAsfactors = FALSE, useFancyQuotes = FALSE) | 13 options(stringAsfactors = FALSE, useFancyQuotes = FALSE) |
12 args <- commandArgs(trailingOnly = TRUE) | 14 args <- commandArgs(trailingOnly = TRUE) |
13 | 15 |
14 #get options, using the spec as defined by the enclosed list. | 16 #get options, using the spec as defined by the enclosed list. |
15 #we read the options from the default: commandArgs(TRUE). | 17 #we read the options from the default: commandArgs(TRUE). |
16 spec = matrix(c( | 18 spec <- matrix(c( |
17 'rdata', 'r', 1, "character", | 19 "rdata", "r", 1, "character", |
18 'primaryfactor', 'p', 1, "character", | 20 "primaryfactor", "p", 1, "character", |
19 'geneid', 'g', 1, "character", | 21 "geneid", "g", 1, "character", |
20 'genefile', 'f', 1, "character", | 22 "genefile", "f", 1, "character", |
21 'fdr', 'c', 1, "double", | 23 "fdr", "c", 1, "double", |
22 'transcripts', 't', 1, "logical", | 24 "transcripts", "t", 1, "logical", |
23 'names', 'a', 1, "logical", | 25 "names", "a", 1, "logical", |
24 'normcounts', 'n', 1, "logical", | 26 "normcounts", "n", 1, "logical", |
25 'splicing', 's', 1, "logical" | 27 "splicing", "s", 1, "logical" |
26 ), byrow=TRUE, ncol=4); | 28 ), byrow = TRUE, ncol = 4); |
27 opt = getopt(spec); | 29 opt <- getopt(spec); |
28 | 30 |
29 res <- readRDS(opt$rdata) | 31 res <- readRDS(opt$rdata) |
30 | 32 |
31 if (!is.null(opt$genefile)) { | 33 if (!is.null(opt$genefile)) { |
32 genes <- read.delim(opt$genefile, header=FALSE) | 34 genes <- read.delim(opt$genefile, header = FALSE) |
33 genes <- genes[, 1] | 35 genes <- genes[, 1] |
34 } else { | 36 } else { |
35 genes <- opt$geneid | 37 genes <- opt$geneid |
36 } | 38 } |
37 | 39 |
38 pdf("plot.pdf") | 40 pdf("plot.pdf") |
39 for (i in genes){ | 41 for (i in genes) { |
40 plotDEXSeq(res, i, FDR=opt$fdr, fitExpToVar=opt$primaryfactor, | 42 plotDEXSeq(res, i, FDR = opt$fdr, fitExpToVar = opt$primaryfactor, |
41 norCounts=opt$normcounts, expression=TRUE, splicing=opt$splicing, | 43 norCounts = opt$normcounts, expression = TRUE, splicing = opt$splicing, |
42 displayTranscripts=opt$transcripts, names=opt$names, legend=TRUE, | 44 displayTranscripts = opt$transcripts, names = opt$names, legend = TRUE, |
43 color=NULL, color.samples=NULL, transcriptDb=NULL) | 45 color = NULL, color.samples = NULL, transcriptDb = NULL) |
44 } | 46 } |
45 dev.off() | 47 dev.off() |
46 | 48 |
47 sessionInfo() | 49 sessionInfo() |