diff edgeR_repenrich.R @ 13:530626b0757c draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/repenrich commit df6b9491ad06e8a85e67c663b68db3cce3eb0115
author artbio
date Tue, 02 Apr 2024 21:16:37 +0000
parents 6bba3e33c2e7
children
line wrap: on
line diff
--- a/edgeR_repenrich.R	Mon Mar 18 09:39:44 2024 +0000
+++ b/edgeR_repenrich.R	Tue Apr 02 21:16:37 2024 +0000
@@ -19,7 +19,6 @@
 options(stringAsFactors = FALSE, useFancyQuotes = FALSE)
 
 # get options, using the spec as defined by the enclosed list.
-# we read the options from the default: commandArgs(TRUE).
 spec <- matrix(
     c(
         "quiet", "q", 0, "logical",
@@ -30,8 +29,6 @@
         "levelNameB", "B", 1, "character",
         "levelAfiles", "a", 1, "character",
         "levelBfiles", "b", 1, "character",
-        "alignmentA", "i", 1, "character",
-        "alignmentB", "j", 1, "character",
         "plots", "p", 1, "character"
     ),
     byrow = TRUE, ncol = 4
@@ -65,17 +62,7 @@
     counts <- cbind(counts, listB[[element]][, 4])
 }
 colnames(counts) <- c(names(listA[-1]), names(listB[-1]))
-
-# build aligned counts vector
-filesi <- fromJSON(opt$alignmentA, method = "C", unexpected.escape = "error")
-filesj <- fromJSON(opt$alignmentB, method = "C", unexpected.escape = "error")
-sizes <- c()
-for (file in filesi) {
-    sizes <- c(sizes, read.delim(file, header = TRUE)[1, 1])
-}
-for (file in filesj) {
-    sizes <- c(sizes, read.delim(file, header = TRUE)[1, 1])
-}
+sizes <- colSums(counts)
 
 # build a meta data object
 meta <- data.frame(
@@ -187,6 +174,3 @@
 results$log2FC <- format(results$log2FC, digits = 5)
 results$FDR <- format(results$FDR, digits = 5)
 write.table(results, opt$outfile, quote = FALSE, sep = "\t", col.names = TRUE, row.names = FALSE)
-
-cat("Session information:\n\n")
-sessionInfo()