If the x object contains multiple columns for the coefficients slot and one of the column contains NA values, the function fails. If I run this function with an existing object fit.eb that goes into the x parameter:
The status object is similar in structure to the folllowing:
If the status vector has NA values to start with
cbind( table = data.frame(1:4), status = list( c(1), c(2), NULL, c(4)))
If the status vector has no NA values to start with (but plainly the formatting is still wrong??)
cbind(data.frame(1:4), list( c(1), c(2),c(3), c(4)))
I have found a fix but haven't worked out how to do a pull request yet. The fix looks like this in the buildXYData function:
This is a fix
status <- sapply(status, function (x) {
switch(ifelse(!is.na(x), as.character(x), "NA" ), "-1"="downReg", "0"="nonDE", "1"="upReg", "NA" = "NA")
})
Replaing the following lines
status <- sapply(status, function (x) {
switch( as.character(x), "-1"="downReg", "0"="nonDE", "1"="upReg")
})
keep the following two lines
if (length(status)!=nrow(table)) stop("Status vector
must have the same number of genes as the main arguments.")
This is a fix
table <- base::cbind(table, status=as.vector(unlist(status)))
Replacing the following line
table <- base::cbind(table, status=as.vector(status))
If the x object contains multiple columns for the coefficients slot and one of the column contains NA values, the function fails. If I run this function with an existing object fit.eb that goes into the x parameter:
glimmaVolcano(x=fit.eb, coef=3 )
I get the following error function:
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, : arguments imply differing number of rows: 1, 0 11. stop(gettextf("arguments imply differing number of rows: %s", paste(unique(nrows), collapse = ", ")), domain = NA) 10. (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, fix.empty.names = TRUE, stringsAsFactors = FALSE) { data.row.names <- if (check.rows && is.null(row.names)) ... 9. do.call(data.frame, c(x, alis)) 8. as.data.frame.list(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) 7. as.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) 6. data.frame(..., check.names = FALSE) 5. cbind(deparse.level, ...) 4. base::cbind(table, status = as.vector(status)) 3. buildXYData(table, status, main, display.columns, anno, counts, xlab, ylab, status.cols, sample.cols, groups, transform.counts) 2. glimmaVolcano.MArrayLM(x = fit.eb, coef = 3) 1. glimmaVolcano(x = fit.eb, coef = 3)
The status object is similar in structure to the folllowing:
If the status vector has NA values to start with cbind( table = data.frame(1:4), status = list( c(1), c(2), NULL, c(4)))
If the status vector has no NA values to start with (but plainly the formatting is still wrong??) cbind(data.frame(1:4), list( c(1), c(2),c(3), c(4)))
I have found a fix but haven't worked out how to do a pull request yet. The fix looks like this in the buildXYData function:
This is a fix status <- sapply(status, function (x) { switch(ifelse(!is.na(x), as.character(x), "NA" ), "-1"="downReg", "0"="nonDE", "1"="upReg", "NA" = "NA") })
Replaing the following lines status <- sapply(status, function (x) { switch( as.character(x), "-1"="downReg", "0"="nonDE", "1"="upReg") })
keep the following two lines if (length(status)!=nrow(table)) stop("Status vector must have the same number of genes as the main arguments.")
This is a fix table <- base::cbind(table, status=as.vector(unlist(status)))
Replacing the following line table <- base::cbind(table, status=as.vector(status))