hasaru-k / GlimmaV2

interactive plots for differential expression analysis
GNU Lesser General Public License v3.0
25 stars 8 forks source link

glimmaVolcano.MArrayLM when x contains multiple columns coefficients it fails #97

Open IgnatiusPang opened 1 month ago

IgnatiusPang commented 1 month ago

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: