theislab/scvelo

AttributeError after "scv.pp.moments" command

panapapa14 opened this issue · 1 comments

Hi there. I have been trying to run scvelo for two weeks now, figuring out workarounds for several issues like memory ones and so on.
Having downsampled my dataset, reduced certain parameters, kept genes of certain expression levels and done PCA, I was hopinng to find a way to make it work, but nope.
Now I am dealing with the following error:

scv.pp.moments(adata_filtered_spliced, n_pcs=20, n_neighbors=5)
Traceback (most recent call last):
File "", line 1, in
File "/home/splab/miniconda3/lib/python3.12/site-packages/scvelo/preprocessing/moments.py", line 63, in moments
neighbors(
File "/home/splab/miniconda3/lib/python3.12/site-packages/scvelo/preprocessing/neighbors.py", line 223, in neighbors
n_duplicate_cells = len(get_duplicate_cells(adata))
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/splab/miniconda3/lib/python3.12/site-packages/scvelo/preprocessing/neighbors.py", line 555, in get_duplicate_cells
X_new = np.array(X[idx_dup].A if issparse(X) else X[idx_dup])
^^^^^^^^^^^^
AttributeError: 'csr_matrix' object has no attribute 'A'
...
Everything is updated and I even tried (multiple times) to proceed to manual changes of the involved .py files (according to the error).

Any help would be extremely valuable! Thank you for your time.

# paste your code here, if applicable
Error output
# paste the error output here, if applicable
Versions
# paste the ouput of scv.logging.print_versions() here

Duplicate of #1260; see #1263.