wot
wot copied to clipboard
pg.neighbors(adata_var) error
Thanks for the great tool!
I am running the notebook 1 tutorial, and the got the following error while running "pg.neighbors(adata_var)":
pg.neighbors(adata_var) Traceback (most recent call last): File "
", line 1, in File "~path/lib/python3.8/site-packages/pegasus/tools/nearest_neighbors.py", line 276, in neighbors indices, distances = get_neighbors( File "~path/python3.8/site-packages/pegasusio/decorators.py", line 12, in wrapper_timer result = func(*args, **kwargs) File "~path/python3.8/site-packages/pegasus/tools/nearest_neighbors.py", line 161, in get_neighbors data.register_attr(indices_key, "knn") AttributeError: 'AnnData' object has no attribute 'register_attr'
Could you please help to check?
Thank you so much!
In the latest version of pegasus, you 1st need to convert adata_var from an instance of AnnData to MultimodalData:
import pegasusio as io
mmdata = io.MultimodalData(adata_var)
pg.neighbors(mmdata)
Thank you so much! It worked! :)