diff 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
line wrap: on
line diff
--- a/deseq2.R	Thu Dec 06 15:49:22 2018 -0500
+++ b/deseq2.R	Mon Jan 28 12:04:08 2019 -0500
@@ -46,7 +46,8 @@
 spec <- matrix(c(
   "quiet", "q", 0, "logical",
   "help", "h", 0, "logical",
-  "batch_factors", "", 1, "character",
+  "cores", "s", 0, "integer",
+  "batch_factors", "w", 1, "character",
   "outfile", "o", 1, "character",
   "countsfile", "n", 1, "character",
   "rlogfile", "r", 1, "character",
@@ -105,6 +106,14 @@
   library("gplots")
 })
 
+if (opt$cores > 1) {
+  library("BiocParallel")
+  register(MulticoreParam(opt$cores))
+  parallel = TRUE
+} else {
+  parallel = FALSE
+}
+
 # build or read sample table
 
 trim <- function (x) gsub("^\\s+|\\s+$", "", x)
@@ -273,7 +282,7 @@
 if (verbose) cat(paste("using disperion fit type:",fitType,"\n"))
 
 # run the analysis
-dds <- DESeq(dds, fitType=fitType, betaPrior=betaPrior, minReplicatesForReplace=minRep)
+dds <- DESeq(dds, fitType=fitType, betaPrior=betaPrior, minReplicatesForReplace=minRep, parallel=parallel)
 
 # create the generic plots and leave the device open
 if (!is.null(opt$plots)) {