broadinstitute / wot

A software package for analyzing snapshots of developmental processes
https://broadinstitute.github.io/wot/
BSD 3-Clause "New" or "Revised" License
140 stars 34 forks source link

pg.neighbors(adata_var) error #97

Open noobugs opened 2 years ago

noobugs commented 2 years ago

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!

joshua-gould commented 2 years ago

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)
noobugs commented 2 years ago

Thank you so much! It worked! :)