-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Neighbors.compute_neighbors() got an unexpected keyword argument 'write_knn_indices' #1212
Comments
@akhst7, I suggest you computer the PCA embedding and neighbor graph directly with the corresponding Scanpy functions, i.e., sc.pp.pca(adata)
sc.pp.neighbors(adata, n_pcs=30, n_neighbors=30) and pass |
Thanks. It worked beautifully. |
Unfortunateley same issue here:
|
I also encountered same error "Neighbors.compute_neighbors() got an unexpected keyword argument 'write_knn_indices'", even I tried: scv.pp.pca(adata) |
Did you solve the problem? I also found the porblem, but it doesn't work. |
Hi guys, @YuriPPAN , @BoyuJiang95 , do you mind that should use sc. rather than scv.? |
Hi @yifanfu01, thank you! I uesd the sc and now scvelo works well with my data. Best, |
Firing
scv.pp.moments(adata, n_pcs=30, n_neighbors=30)
runs into an error....
Error output
TypeError Traceback (most recent call last)
Cell In[22], line 1
----> 1 scv.pp.moments(adata, n_pcs=30, n_neighbors=30)
File ~/miniconda3/lib/python3.11/site-packages/scvelo/preprocessing/moments.py:63, in moments(data, n_neighbors, n_pcs, mode, method, use_rep, use_highly_variable, copy)
60 normalize_per_cell(adata)
62 if n_neighbors is not None and n_neighbors > get_n_neighs(adata):
---> 63 neighbors(
64 adata,
65 n_neighbors=n_neighbors,
66 use_rep=use_rep,
67 use_highly_variable=use_highly_variable,
68 n_pcs=n_pcs,
69 method=method,
70 )
71 verify_neighbors(adata)
73 if "spliced" not in adata.layers.keys() or "unspliced" not in adata.layers.keys():
File ~/miniconda3/lib/python3.11/site-packages/scvelo/preprocessing/neighbors.py:257, in neighbors(adata, n_neighbors, n_pcs, use_rep, use_highly_variable, knn, random_state, method, metric, metric_kwds, num_threads, copy)
246 neighbors = _get_hnsw_neighbors(
247 adata=adata,
248 use_rep=use_rep,
(...)
254 **metric_kwds,
255 )
256 elif method in ["umap", "gauss", "rapids"]:
--> 257 neighbors = _get_scanpy_neighbors(
258 adata=adata,
259 n_neighbors=n_neighbors,
260 knn=knn,
261 n_pcs=n_pcs,
262 method=method,
263 use_rep=use_rep,
264 random_state=random_state,
265 metric=metric,
266 metric_kwds=metric_kwds,
267 )
268 else:
269 raise ValueError(
270 f"Provided
method={method}
. Admissible values are'umap'
,'sklearn'
, "271 "
'hnsw'
,'gauss'
, and'rapids'
."272 )
File ~/miniconda3/lib/python3.11/site-packages/scvelo/preprocessing/neighbors.py:40, in _get_scanpy_neighbors(adata, **kwargs)
38 warnings.simplefilter("ignore")
39 neighbors = Neighbors(adata)
---> 40 neighbors.compute_neighbors(write_knn_indices=True, **kwargs)
41 logg.switch_verbosity("on", module="scanpy")
43 return neighbors
TypeError: Neighbors.compute_neighbors() got an unexpected keyword argument 'write_knn_indices'
Versions
scvelo==0.3.1 scanpy==1.10.0.dev219+g3ddf1ee1 anndata==0.10.5.post1 loompy==3.0.7 numpy==1.26.4 scipy==1.12.0 matplotlib==3.8.3 sklearn==1.4.1.post1 pandas==2.2.1
ERROR: XMLRPC request failed [code: -32500]
RuntimeError: PyPI no longer supports 'pip search' (or XML-RPC search). Please use https://pypi.org/search (via a browser) instead. See https://warehouse.pypa.io/api-reference/xml-rpc.html#deprecated-methods for more information.
The text was updated successfully, but these errors were encountered: