ValueError: Your adata doesn't have the key for Vector Field with None basis.
See original GitHub issueHi @Xiaojieqiu
When running your zebrafish example, I encountered the following error when running dyn.pl.plot_energy(adata)
.
ValueError Traceback (most recent call last)
----> 1 dyn.pl.plot_energy(adata)
python3.8/site-packages/dynamo/plot/scVectorField.py in plot_energy(adata, basis, vecfld_dict, figsize, fig, save_show_or_return, save_kwargs)
1198 vf_key = "VecFld" if basis is None else "VecFld_" + basis
1199 if vf_key not in adata.uns.keys():
-> 1200 raise ValueError( f"Your adata doesn't have the key for Vector Field with {basis} basis."
1202 f"Try firstly running dyn.tl.VectorField(adata, basis={basis})."
ValueError: Your adata doesn't have the key for Vector Field with None basis. Try firstly running dyn.tl.VectorField(adata, basis=None).
Moreover, when changing the code to dyn.pl.plot_energy(adata, basis="umap")
, I received the following error which seems due to the missing VecFld+basis
key in our data.
KeyError Traceback (most recent call last)
----> 1 dyn.pl.plot_energy(adata, basis="umap")
python3.8/site-packages/dynamo/plot/scVectorField.py in plot_energy(adata, basis, vecfld_dict, figsize, fig, save_show_or_return, save_kwargs)
1205 vecfld_dict = adata.uns[vf_key]
1206
-> 1207 E = vecfld_dict["VecFld"]["E_traj"] if "E_traj" in vecfld_dict["VecFld"] else None
1208 tecr = vecfld_dict["VecFld"]["tecr_traj"] if "tecr_traj" in vecfld_dict["VecFld"] else None
1209
KeyError: 'VecFld'
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top GitHub Comments
M is for the number control point and cannot be larger than the total cell number. Moreover, in general, it should only be a few hundred (like 100) because we only need a small number of control points to approximate the vector field which also gives tremendous computational speedup.
Please try python setup install the latest version of dynamo, pulled from this github repo. And then rerun the code I shared above. We will try to release a new version (1.0.1) on PyPi soon
I will do so. I appreciate your clarification.