bnprks / BPCells

Scaling Single Cell Analysis to Millions of Cells
https://bnprks.github.io/BPCells
Other
166 stars 17 forks source link

Cannot convert BPcells matrix to dgcMatrix #95

Open RookieA1 opened 4 months ago

RookieA1 commented 4 months ago

Thank you for bringing such a convenient tool for single cell analysis, but I'm having some problems with the actual use of it, I'm getting an error when I try to convert the BPcells object read from the h5ad file to dgcMatrix, I've checked the original matrix in detail and there's no problem, do you have any idea how to fix it please? image image

bnprks commented 4 months ago

Ah, amusingly this is an error in my error message and it will be fixed with the pull request linked above.

Ultimately, though, your problem is that the matrix you are trying to convert to a dgCMatrix is larger than dgCMatrix objects can handle (which is about 2^31 non-zero entries in the matrix). So while BPCells can operate on this whole matrix with no problem, you can only convert subsets of the matrix to a dgCMatrix without exceeding the limits of the dgCMatrix type itself.

That error message should have said:

Error converting IterableMatrix to dgCMatrix
- dgCMatrix objects cannot hold more than 2^31 non-zero entries
- Input matrix has ... entries

Where ... would be filled in by the actual number of entries in your given matrix.