diff limma_voom.R @ 12:81796eb60bd0 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/limma_voom commit 33651907e4d5d6672537b80142c022d2b4951e8c
author iuc
date Sun, 05 Aug 2018 05:13:12 -0400
parents 7e8af58c8052
children d5a940112511
line wrap: on
line diff
--- a/limma_voom.R	Mon Jun 11 08:18:25 2018 -0400
+++ b/limma_voom.R	Sun Aug 05 05:13:12 2018 -0400
@@ -166,6 +166,7 @@
     "totReq", "y", 0, "logical",
     "cntReq", "z", 1, "integer",
     "sampleReq", "s", 1, "integer",
+    "filtCounts", "F", 0, "logical",
     "normCounts", "x", 0, "logical",
     "rdaOpt", "r", 0, "logical",
     "lfcReq", "l", 1, "double",
@@ -218,6 +219,12 @@
     haveAnno <- TRUE
 }
 
+if (is.null(opt$filtCounts)) {
+    wantFilt <- FALSE
+} else {
+    wantFilt <- TRUE
+}
+
 if (is.null(opt$normCounts)) {
     wantNorm <- FALSE
 } else {
@@ -364,7 +371,7 @@
     topOut[i] <- makeOut(paste0(deMethod, "_", con, ".tsv"))
     glimmaOut[i] <- makeOut(paste0("glimma_", con, "/MD-Plot.html"))
 }
-
+filtOut <- makeOut(paste0(deMethod, "_filtcounts.tsv"))
 normOut <- makeOut(paste0(deMethod, "_normcounts.tsv"))
 rdaOut <- makeOut(paste0(deMethod, "_analysis.RData"))
 sessionOut <- makeOut("session_info.txt")
@@ -440,6 +447,13 @@
     data$counts <- data$counts[keep, ]
     data$genes <- data$genes[keep, , drop=FALSE]
 
+    if (wantFilt) {
+        print("Outputting filtered counts")
+        filt_counts <- data.frame(data$genes, data$counts)
+        write.table(filt_counts, file=filtOut, row.names=FALSE, sep="\t", quote=FALSE)
+        linkData <- rbind(linkData, data.frame(Label=paste0(deMethod, "_", "filtcounts.tsv"), Link=paste0(deMethod, "_", "filtcounts.tsv"), stringsAsFactors=FALSE))
+    }
+
     # Plot Density
     if ("d" %in% plots) {
         # PNG