Skip to content
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

AttributeError: recarray has no attribute columns #33

Open
PGmajev opened this issue Feb 17, 2023 · 0 comments
Open

AttributeError: recarray has no attribute columns #33

PGmajev opened this issue Feb 17, 2023 · 0 comments

Comments

@PGmajev
Copy link

PGmajev commented Feb 17, 2023

Hello,

thank you for creating milopy! I have been using it quite often lately, but now I discovered an issue:

When I start a Jupyterlab kernel, load milo as in your documentation and run it on an AnnData Object, it works flawlessly. However, if I then run it again directly after in the same session (even after reloading the AnnData Object), I get the error AttributeError: recarray has no attribute columns.

This is the code I ran:

milo.make_nhoods(adata)
milo.count_nhoods(adata, sample_col="SAMPLE")
milo.DA_nhoods(adata, design="~ GROUP")

I traced this down to the core module in line 240 (DA_nhoods), where the res object is not properly converted from R. I can quickfix this by adding

if isinstance(res, np.recarray):
        res = pd.DataFrame(res)

But probably this issue runs deeper and concerns the rpy2 conversion process?

Is this something you have encountered as well? Or do you need further information from my side to reproduce it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant