comparison deseq2.R @ 21:a6fc9228e1a0 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/deseq2 commit 05bc13637dc9f8e523bc72844ff6eb0794f98ad3
author iuc
date Mon, 28 Jan 2019 12:04:08 -0500
parents c56e0689e46e
children 71bacea10eee
comparison
equal deleted inserted replaced
20:89d26b11d452 21:a6fc9228e1a0
44 # get options, using the spec as defined by the enclosed list. 44 # get options, using the spec as defined by the enclosed list.
45 # we read the options from the default: commandArgs(TRUE). 45 # we read the options from the default: commandArgs(TRUE).
46 spec <- matrix(c( 46 spec <- matrix(c(
47 "quiet", "q", 0, "logical", 47 "quiet", "q", 0, "logical",
48 "help", "h", 0, "logical", 48 "help", "h", 0, "logical",
49 "batch_factors", "", 1, "character", 49 "cores", "s", 0, "integer",
50 "batch_factors", "w", 1, "character",
50 "outfile", "o", 1, "character", 51 "outfile", "o", 1, "character",
51 "countsfile", "n", 1, "character", 52 "countsfile", "n", 1, "character",
52 "rlogfile", "r", 1, "character", 53 "rlogfile", "r", 1, "character",
53 "vstfile", "v", 1, "character", 54 "vstfile", "v", 1, "character",
54 "header", "H", 0, "logical", 55 "header", "H", 0, "logical",
102 suppressPackageStartupMessages({ 103 suppressPackageStartupMessages({
103 library("DESeq2") 104 library("DESeq2")
104 library("RColorBrewer") 105 library("RColorBrewer")
105 library("gplots") 106 library("gplots")
106 }) 107 })
108
109 if (opt$cores > 1) {
110 library("BiocParallel")
111 register(MulticoreParam(opt$cores))
112 parallel = TRUE
113 } else {
114 parallel = FALSE
115 }
107 116
108 # build or read sample table 117 # build or read sample table
109 118
110 trim <- function (x) gsub("^\\s+|\\s+$", "", x) 119 trim <- function (x) gsub("^\\s+|\\s+$", "", x)
111 120
271 } 280 }
272 281
273 if (verbose) cat(paste("using disperion fit type:",fitType,"\n")) 282 if (verbose) cat(paste("using disperion fit type:",fitType,"\n"))
274 283
275 # run the analysis 284 # run the analysis
276 dds <- DESeq(dds, fitType=fitType, betaPrior=betaPrior, minReplicatesForReplace=minRep) 285 dds <- DESeq(dds, fitType=fitType, betaPrior=betaPrior, minReplicatesForReplace=minRep, parallel=parallel)
277 286
278 # create the generic plots and leave the device open 287 # create the generic plots and leave the device open
279 if (!is.null(opt$plots)) { 288 if (!is.null(opt$plots)) {
280 if (verbose) cat("creating plots\n") 289 if (verbose) cat("creating plots\n")
281 pdf(opt$plots) 290 pdf(opt$plots)