Add row/colsum fallbacks for non-DA/base matrix classes.#57
Add row/colsum fallbacks for non-DA/base matrix classes.#57LTLA wants to merge 1 commit intoBioconductor:masterfrom LTLA:master
Conversation
|
This should not be necessary. So either you wrap your sparse matrix in a DelayedArray object and call or, if that's not convenient enough, we could just temporarily add the 2 following lines to DelayedArray (until the sparseMatrixStats package provides a native implementation for this): |
|
Oh, good.
Well, if it's going to be a stopgap, I would like a fallback |
Tempting but I don't like the smell of this. I believe in the strong principle of keeping the base function the default method. I don't think the R/CRAN/Bioconductor democracy can work if package developers start feeling that they know what THE default method should do and thus take possession of it. What would prevent other packages from doing the same thing? This would quickly become messy. In other words, we don't own That being said, I'm not saying that you won't find places in the S4Vectors/IRanges/GenomicRanges stack or in one of my other packages where I'm doing exactly what I'm preaching against (either because I didn't know what I was doing at the time or because it was introduced by someone else ;-) ) |
|
Hm. Sounds like I should just keep on using my |
|
Or you can wrap whatever matrix-like object you have inside a DelayedArray shell and pass it to |
Pretty much as it says. The aim is to provide some slow inefficient fallbacks for these generics so that they can operate on sparse matrices (or anything with a
colSumsandrowSumsmethod).Perhaps these won't live in DelayedArray in the long term, but this is a good enough location for the time being; it allows me to actually use these generics in my various packages. Right now I'm wrapping
colsumin another scater generic (.colsum) in order to catch the non-DA/non-base case.