changeset 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 89d26b11d452
children e5c8afac22a7
files deseq2.R deseq2.xml
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
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)) {
--- a/deseq2.xml	Thu Dec 06 15:49:22 2018 -0500
+++ b/deseq2.xml	Mon Jan 28 12:04:08 2019 -0500
@@ -1,4 +1,4 @@
-<tool id="deseq2" name="DESeq2" version="2.11.40.4">
+<tool id="deseq2" name="DESeq2" version="2.11.40.5">
     <description>Determines differentially expressed features from count tables</description>
     <requirements>
         <requirement type="package" version="1.20.0">bioconductor-deseq2</requirement>
@@ -41,6 +41,7 @@
 #import json
 #import os
 Rscript '${__tool_directory__}/deseq2.R'
+    --cores \${GALAXY_SLOTS:-1}
     -o '$deseq_out'
     #if $pdf:
         -p '$plots'