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

MOFA analysis with missing modalities and sparse matrices fails with ValueError: setting an array element with a sequence #106

Closed
VPetukhov opened this issue May 12, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@VPetukhov
Copy link

The bug description
I have multiple samples, some of them have CITE-seq data, while others only have scRNA-seq data. Integrating them with MOFA and use_obs='union' fails:

mu.tl.mofa(mdata_joint, groups_label=BATCH_VAR, use_obs='union')

Error:

162         ix = expanded.join(orig, how="right").ix.values
164         # set expanded data with part of the orig data
--> 165         x[ix, :] = mdata[m].X
166         data[i] = x
168 # Subset features if required

ValueError: setting an array element with a sequence.

The reason
It all comes from this line. The problem is that mdata[m].X is sparse, while x[ix, :] is dense. Probably, the same logic as before should be applied here.

System

  • OS: macOS Ventura 13.3.1, M1
  • Python version: 3.9.16
  • Versions of libraries involved: muon==0.1.3
@VPetukhov VPetukhov added the bug Something isn't working label May 12, 2023
@gtca gtca closed this as completed in 581354b Jun 8, 2023
@gtca
Copy link
Collaborator

gtca commented Jun 8, 2023

Thanks! Fixed as suggested, and I added a small test with this use case as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants