-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
PROPER_1.30.0
R version 4.2.1
Running estParam() with a matrix in R > 4 will throw an error due to matrix objects now inheriting from both "matrix" and "array" classes, which breaks code assuming class(matrix_obj)) has length one.
See
https://stackoverflow.com/questions/64660948/issue-with-creating-a-matrix-in-r
https://cran.r-project.org/doc/manuals/r-release/NEWS.html for R 4.0.0 release
lmu0=rnorm(20000,5,2)
lOD0=rnorm(20000,-4,1)
lmu=exp(rnorm(20000*10,lmu0,exp(lOD0)))
X=matrix(rpois(20000*10,lmu),20000,10)
class(X)
param=estParam(X)
Replacing the test with !inherits(X, c("ExpressionSet", "matrix")) fixes the issue
estParam2 <- function (X, type = 1)
{
# if (!class(X) %in% c("ExpressionSet", "matrix"))
# stop("input X should be either an ExpressionSet or a matrix")
if (!inherits(X, c("ExpressionSet", "matrix")))
stop("input X should be either an ExpressionSet or a matrix")
if (!is.matrix(X))
X = exprs(X)
if (!(type == 1 | type == 2))
stop("type must be either 1 or 2")
if (type == 1) {
res = PROPER:::getDisp1(X)
}
if (type == 2) {
require(edgeR)
res = PROPER:::getDisp2(X)
}
res
}
Can submit a pull request if needed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels


