You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just to give a quick update on this, the simplest patch is to explicitly convert the unspliced data into a dense array when it comes in as sparse since there's no argsort equivalent for csr_matrix. I don't think this is the best solution because it will require more memory than necessary.
I figured as much, given that np.argsort by defnition returns a dense matrix since all the zero value return non-zero indices. Unfortunately, calling .todense() on too large datasets does blow up in memory quite a bit, possibly to the point of crashing.
Maybe solution could be to convert the matrices to dense in batches, something along these lines:
Thanks for the suggestion. I'm personally leaning towards a solution that natively deals with the sparse matrix instead of having to implicitly convert to dense. I'm also looking into what might be a potential bug in this whole preprocessing step.
Issue
The
scvi.external.velovi.VELOVI
class usesnp.argsort
on the spliced/unspliced matrices, but this returnsarray([0])
when these matrices are sparse.Minimally reproducible code
Versions:
(Installed with
pip install git+https://github.com/scverse/scvi-tools
on 4/4/24 ~12:00, as velovi is not available in the current pypi/conda release)The text was updated successfully, but these errors were encountered: