Skip to content

AttributeError: recarray has no attribute columns #33

Description

@PGmajev

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions