Skip to content

preprocessing data error :TypeError: Neighbors.compute_neighbors() got an unexpected keyword argument 'write_knn_indices' #6

@yangqianBLCU

Description

@yangqianBLCU

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions