-
Notifications
You must be signed in to change notification settings - Fork 3
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
leidenalg issue #3
Comments
I haven't met this error before. My leidenalg version is 0.8.7. It seems to me that the error might be from the input data as it says |
First I tried to run your code as it was without making any changes and received this error, |
can you post a link to your |
@ys-zong |
I'm using pythton-igraph 0.9.6 |
Using leidenalg=0.8.7 an pythton-igraph=0.9.6 finally fixed the issue. It would be greate if you can mention this requirement in readme file. |
If you use the latest version of both (leidenalg 0.9.0 and igraph 0.10.2), things should work fine. If you see an incompatibility between these specific versions, you should probably report it to leidenalg. |
Hey,
I was trying to run your code on my local but leidenalg keeps giving this error:
BaseException: Could not construct partition: Weight vector not the same size as the number of edges.
I have tried using every version of leidenalg from 0.7.0 to 0.9.0.
Do you happen to know any work around.
Complete Error Message:
`BaseException Traceback (most recent call last)
/tmp/ipykernel_58748/2566975975.py in
35 sc.pp.neighbors(adata_conST, n_neighbors=params.eval_graph_n)
36
---> 37 eval_resolution = res_search_fixed_clus(adata_conST, n_clusters)
38 print(eval_resolution)
39 cluster_key = "conST_leiden"
/media/nikhilmehta/New Volume/01IITK/Sem 7/CS690/conST/src/utils_func.py in res_search_fixed_clus(adata, fixed_clus_count, increment)
36 '''
37 for res in sorted(list(np.arange(0.01, 2.5, increment)), reverse=True):
---> 38 sc.tl.leiden(adata, random_state=0, resolution=res)
39 count_unique_leiden = len(pd.DataFrame(adata.obs['leiden']).leiden.unique())
40 if count_unique_leiden == fixed_clus_count:
~/anaconda3/envs/cs690/lib/python3.7/site-packages/scanpy/tools/_leiden.py in leiden(adata, resolution, restrict_to, random_state, key_added, adjacency, directed, use_weights, n_iterations, partition_type, neighbors_key, obsp, copy, **partition_kwargs)
142 partition_kwargs['resolution_parameter'] = resolution
143 # clustering proper
--> 144 part = leidenalg.find_partition(g, partition_type, **partition_kwargs)
145 # store output into adata.obs
146 groups = np.array(part.membership)
~/anaconda3/envs/cs690/lib/python3.7/site-packages/leidenalg/functions.py in find_partition(graph, partition_type, initial_membership, weights, n_iterations, max_comm_size, seed, **kwargs)
81 kwargs['weights'] = weights
...
--> 856 singleton partition.
857
858 weights : list of double, or edge attribute
BaseException: Could not construct partition: Weight vector not the same size as the number of edges.`
The text was updated successfully, but these errors were encountered: