pneuvial / c3co

Inferring cancer cell clonality from copy-number data
5 stars 1 forks source link

Annoying 'Note' displayed by function 'kronecker' about sparse matrices #18

Closed pneuvial closed 7 years ago

pneuvial commented 7 years ago
> example(c3co)
Note: method with signature ‘dsparseMatrix#dsparseMatrix’ chosen for function ‘kronecker’,
target signature ‘dgCMatrix#dgTMatrix’.
"sparseMatrix#TsparseMatrix" would also be valid
pneuvial commented 7 years ago

Reproducible example:

W <- matrix(1:6, 3, 2)
L <- 5
p <- ncol(W)
Dm1 <- -Matrix::bandSparse(L, L, k=0:(L-1))
X <- kronecker(Dm1, W)
pneuvial commented 7 years ago

Can be fixed (e.g.) by converting W to a sparse matrix:

W <- matrix(1:6, 3, 2)
W <- as(W, "sparseMatrix")
L <- 5
p <- ncol(W)
Dm1 <- -Matrix::bandSparse(L, L, k=0:(L-1), giveCsparse = FALSE)
X <- kronecker(Dm1, W)

Fixed likewise in [develop cb8a136]