Closed dselivanov closed 8 years ago
Good idea. I've added support for dgCMatrix
by converting the column pointer into a column index. It could be made more efficient by natively operating on the CSC storage, but this is a good first step. I'll try to revisit in the future.
Hi,
I am using the latest coop, 0.6-3 installed from GitHub, and having a related issue as follows;
sparsity(su.int.mtfil@assays$integrated@data)
Error in UseMethod("sparsity") :
no applicable method for 'sparsity' applied to an object of class "c('dgCMatrix', 'CsparseMatrix', 'dsparseMatrix', 'generalMatrix', 'dCsparseMatrix', 'AnyMatrix', 'dMatrix', 'sparseMatrix', 'compMatrix', 'Matrix', 'xMatrix', 'mMatrix', 'replValueSp')"
Data are in the dgCMatrix format ;
@ data :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
.. .. ..@ i : int [1:230157000] 0 1 2 3 4 5 6 7 8 9 ...
.. .. ..@ p : int [1:76720] 0 3000 6000 9000 12000 15000 18000 21000 24000 27000 ...
.. .. ..@ Dim : int [1:2] 3000 76719
.. .. ..@ Dimnames:List of 2
.. .. .. ..$ : chr [1:3000] "Cd74" "S100a9" "Fabp4" "S100a8" ...
.. .. .. ..$ : chr [1:76719] "AAACCCAAGATAGTGT-1_1" "AAACCCAAGGCAATGC-1_1" "AAACCCACACTCAGAT-1_1" "AAACCCACACTCCACT-1_1" ...
.. .. ..@ x : num [1:230157000] 19.718 0.473 -1.498 -1.293 8.137 ...
.. .. ..@ factors : list()
So sparsity
does not support sparse matrices ?
Consider to add support for sparse matrices from
Matrix
package. I supposeMatrix
is the standard and most widely used package for linear algebra with sparse matrices in R.