comparison egsea.R @ 2:ba2111ae6eb4 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/egsea commit ee9b940a5ffa6c52e42a89e55c0f5bdda0a386d5
author iuc
date Mon, 28 Jan 2019 18:39:06 -0500
parents 73281fbdf6c1
children fba1660fb717
comparison
equal deleted inserted replaced
1:73281fbdf6c1 2:ba2111ae6eb4
96 countfiles <- lapply(sampleTable$filename, function(x){read.delim(x, row.names=1)}) 96 countfiles <- lapply(sampleTable$filename, function(x){read.delim(x, row.names=1)})
97 counts <- do.call("cbind", countfiles) 97 counts <- do.call("cbind", countfiles)
98 98
99 } else { 99 } else {
100 # Process the single count matrix 100 # Process the single count matrix
101 counts <- read.table(args$matrixPath, header=TRUE, sep="\t", stringsAsFactors=FALSE) 101 counts <- read.table(args$matrixPath, header=TRUE, sep="\t", stringsAsFactors=FALSE, check.names=FALSE)
102 row.names(counts) <- counts[, 1] 102 row.names(counts) <- counts[, 1]
103 counts <- counts[ , -1] 103 counts <- counts[ , -1]
104 countsRows <- nrow(counts) 104 countsRows <- nrow(counts)
105 105
106 # Process factors 106 # Process factors
107 if (is.null(args$factInput)) { 107 if (is.null(args$factInput)) {
108 factorData <- read.table(args$factFile, header=TRUE, sep="\t") 108 factorData <- read.table(args$factFile, header=TRUE, sep="\t", strip.white=TRUE)
109 # check samples names match
110 if(!any(factorData[, 1] %in% colnames(counts)))
111 stop("Sample IDs in factors file and count matrix don't match")
112 # order samples as in counts matrix
113 factorData <- factorData[match(colnames(counts), factorData[, 1]), ]
109 factors <- factorData[, -1, drop=FALSE] 114 factors <- factorData[, -1, drop=FALSE]
110 } else { 115 } else {
111 factors <- unlist(strsplit(args$factInput, "|", fixed=TRUE)) 116 factors <- unlist(strsplit(args$factInput, "|", fixed=TRUE))
112 factorData <- list() 117 factorData <- list()
113 for (fact in factors) { 118 for (fact in factors) {