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 error when data has been created using axis=-1 #122

Open
dawe opened this issue Aug 23, 2023 · 4 comments
Open

MOFA error when data has been created using axis=-1 #122

dawe opened this issue Aug 23, 2023 · 4 comments

Comments

@dawe
Copy link

dawe commented Aug 23, 2023

Hello, I have a MuData object created exploiting axis=-1 as two modalities share a large portion of obs_names and var_names. The shape of the modalities are

[(4664, 55615), (4664, 55879)]

and mdata object is

(4664, 61764)

I have been trying mofa with mostly default parameters (except for a higher number of factors) and I have this error

ValueError: Value passed for key 'LFs' is of incorrect shape. Values of varm must match dimensions (1,) of parent. Value had shape (111494,) while it should have had (61764,).

which, I suspect, is possibly due to the fact modalities have been passed to MOFA using two independent sets of features and not their union. The LF shape (111494) is indeed the sum of modalities' shapes.

@dawe dawe added the bug Something isn't working label Aug 23, 2023
@gtca gtca removed the bug Something isn't working label Oct 17, 2024
@gtca
Copy link
Collaborator

gtca commented Oct 17, 2024

MOFA specifically and muon in general expect multimodal data. Here mudata is a more flexible container, and it is one of the design challenges how to fail gracefully...

For the MuData object in question, why would modalities share most of their var_names? If the features are different between modalities, it should have axis=0, and then it should work as expected with MOFA and muon.

@dawe
Copy link
Author

dawe commented Oct 17, 2024

Modalities share var_names because they come from multimodal profiling of chromatin, so they are all in format chr:start-end and multiple omics may share position (but not value).

@gtca
Copy link
Collaborator

gtca commented Oct 22, 2024

Sounds like those are different modalities so the default axis=0 should be more appropriate to apply multimodal methods.

To note here, most multimodal methods won't account for feature relationships, i.e. that e.g. accessibility at chr1:2345-6789 is actually the same locus as e.g. methylation of chr1:3000-6000.

axis=-1 would be appropriate to store e.g. snapshots of processing stages where some AnnData objects contain feature/sample subsets of others.

@dawe
Copy link
Author

dawe commented Oct 22, 2024

I see, I'll give a try.
Thanks

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

2 participants