Closed fengshuoliu closed 6 months ago
Hi, thank you for raising this problem. I remember networkx updatefrom_scipy_sparse_matrix
to from_scipy_sparse_array
. Thus, you can solve this by using an earlier version of networkx.
In fact, we have updated this in the latest version of Dynamo. Upgrading the Dynamo should also solve the issue. Let me know if this works.
Hi, thank you for raising this problem. I remember networkx update
from_scipy_sparse_matrix
tofrom_scipy_sparse_array
. Thus, you can solve this by using an earlier version of networkx.In fact, we have updated this in the latest version of Dynamo. Upgrading the Dynamo should also solve the issue. Let me know if this works.
Thanks the issue was solved!
@Xiaojieqiu Dear Team, really nice work and I'm excited to be able to use Dynamo in my analysis.
I ran into an error message " module 'networkx.convert_matrix' has no attribute 'from_scipy_sparse_matrix'", when I do Most probably path predictions, for both my own dataset and the demo dataset provided in package.
specifically I encounter this error for the following chunk of code:
error message:
AttributeError Traceback (most recent call last) Cell In[45], line 17 15 if start is not end: 16 min_lap_t = True if i == 0 else False ---> 17 dyn.pd.least_action( 18 adata_labeling, 19 [adata_labeling.obs_names[start[0]][0]], 20 [adata_labeling.obs_names[end[0]][0]], 21 basis="umap", 22 adj_key="X_umap_distances", 23 min_lap_t= min_lap_t, 24 EM_steps=2, 25 ) 26 dyn.pl.least_action(adata_labeling, basis="umap") 27 lap = dyn.pd.least_action( 28 adata_labeling, 29 [adata_labeling.obs_names[start[0]][0]], (...) 34 EM_steps=2, 35 )
File ~/anaconda3/lib/python3.11/site-packages/dynamo/prediction/least_action_path.py:488, in least_action(adata, init_cells, target_cells, init_states, target_states, paired, min_lap_t, elbow_method, num_t, basis, vf_key, vecfld, adj_key, n_points, init_paths, D, PCs, expr_func, addkey, **kwargs) 485 coords = adata.obsm["X" + basis] 487 T = adata.obsp[adj_key] --> 488 G = nx.convert_matrix.from_scipy_sparse_matrix(T) 490 initstates, , , = fetch_states( 491 adata, 492 init_states, (...) 497 None, 498 ) 499 targetstates, , _, valid_genes = fetch_states( 500 adata, 501 target_states, (...) 506 None, 507 )
AttributeError: module 'networkx.convert_matrix' has no attribute 'from_scipy_sparse_matrix'
I've tried to update the networkx (v3.2.1) and dynamo (v 1.3.2).
Any suggestions are very much appreciated!