-
Notifications
You must be signed in to change notification settings - Fork 5
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
preprocessing data error :TypeError: Neighbors.compute_neighbors() got an unexpected keyword argument 'write_knn_indices' #6
Comments
Hi, This is due to a mismatch of update in scanpy and scvelo. It has been fixed in a new version (see this github page). The preprocessing function in our package is adapted from scVelo for convenience. You can directly use scVelo to preprocess the data and train the model without any problem. Meanwhile, we will fix this issue as soon as possible. My apologies for the inconvenience! Thank you! |
I have solve the error "write_knn_indices", and only trian VeloVAE. Then i will run Post-Training Analysis Compute the Metrics and Plot the Genes, cluster_edges = [('Ngn3 low EP', 'Ngn3 high EP'), File ~/miniconda3/envs/VeloVAE/lib/python3.10/site-packages/velovae/analysis/evaluation.py:455, in post_analysis(adata, test_id, methods, keys, gene_key, compute_metrics, raw_count, genes, plot_type, cluster_key, cluster_edges, nplot, frac, embed, grid_size, sparsity_correction, figure_path, save, **kwargs) KeyError: 'indices' |
I'm also getting the adata.uns['neighbors']['indices'] error. my scanpy object doesn't have indices in the keys.
|
you can try this way. https://blog.csdn.net/weixin_46128755/article/details/138460919?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522172353564416800182156066%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=172353564416800182156066&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-2-138460919-null-null.142^v100^pc_search_result_base8&utm_term=scvelo&spm=1018.2226.3001.4187
| |
yq45646117
|
|
***@***.***
|
---- Replied Message ----
| From | Johnathan ***@***.***> |
| Date | 8/8/2024 03:59 |
| To | ***@***.***> |
| Cc | ***@***.***>,
***@***.***> |
| Subject | Re: [welch-lab/VeloVAE] preprocessing data error :TypeError: Neighbors.compute_neighbors() got an unexpected keyword argument 'write_knn_indices' (Issue #6) |
I'm also getting the adata.uns['neighbors']['indices'] error. my scanpy object doesn't have indices in the keys.
adata.uns['neighbors'].keys()
dict_keys(['connectivities_key', 'distances_key', 'params'])
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
@g-yichen bump could you check my PR? I think I fixed the issue. |
how to solve TypeError: Neighbors.compute_neighbors() got an unexpected keyword argument 'write_knn_indices'
TypeError Traceback (most recent call last)
Cell In[70], line 2
1 n_gene = 2000
----> 2 vv.preprocess(adata_c, n_gene,compute_umap=True,perform_clustering=True)
File ~/miniconda3/envs/VeloVAE/lib/python3.10/site-packages/velovae/preprocessing.py:340, in preprocess(adata, n_gene, cluster_key, tkey, selection_method, min_count_per_cell, min_genes_expressed, min_shared_counts, min_shared_cells, min_counts_s, min_cells_s, max_counts_s, max_cells_s, min_counts_u, min_cells_u, max_counts_u, max_cells_u, npc, n_neighbors, genes_retain, perform_clustering, resolution, compute_umap, umap_min_dist, keep_raw, **kwargs)
327 filter_genes(adata,
328 min_counts=min_counts_s,
329 min_cells=min_cells_s,
(...)
335 max_cells_u=max_cells_u,
336 retain_genes=genes_retain)
338 # 2. KNN Averaging
339 # remove_duplicate_cells(adata)
--> 340 moments(adata, n_pcs=npc, n_neighbors=n_neighbors)
342 if keep_raw:
343 print("Keep raw unspliced/spliced count data.")
File ~/miniconda3/envs/VeloVAE/lib/python3.10/site-packages/velovae/scvelo_preprocessing/moments.py:66, in moments(data, n_neighbors, n_pcs, mode, method, use_rep, copy)
64 use_rep = "X_pca"
65 print(f"Computing the KNN graph based on {use_rep}")
---> 66 neighbors(
67 adata, n_neighbors=n_neighbors, use_rep=use_rep, n_pcs=n_pcs, method=method
68 )
...
161 )
162 logg.switch_verbosity("on", module="scanpy")
164 adata.uns["neighbors"] = {}
TypeError: Neighbors.compute_neighbors() got an unexpected keyword argument 'write_knn_indices'
The text was updated successfully, but these errors were encountered: