microbiome / mia

Microbiome analysis
https://microbiome.github.io/mia/
Artistic License 2.0
46 stars 27 forks source link

Make create_mofa_from_MultiAssayExperiment() accept alternative experiments #412

Open artur-sannikov opened 1 year ago

artur-sannikov commented 1 year ago

Is your feature request related to a problem? Please describe. Currently, to use create_mofa_from_MultiAssayExperiment() on agglomerated data, we have to directly modify the original MAE assays. In contrast getExperimentCrossAssociation() is capable of accepting alternative experiments (see here). I suggest implementing similar functionality for create_mofa_from_MultiAssayExperiment(), which will provide us with more flexibility with running MOFA at different agglomeration levels.

Describe the solution you'd like Add altexp1 and altexp2 parameters in a similar fashion to getExperimentCrossAssociation(). @antagomir suggested to open a PR on he MOFA repo to add these parameters because this function belongs to MOFA2 package.

Describe alternatives you've considered Implement this functionality in mia does not seem to be the most optimal option. The function belongs to MOFA and is more widely used than mia at the moment.

antagomir commented 1 year ago

If MOFA authors would welcome adding support for MAE this way then that would probably be the ideal solution.

TuomasBorman commented 2 months ago

Is there any limitation on how many experiments can be fed to MOFA? I am wondering that if there is no limitation, then there could be for instance 10 different experiments, which makes this altexp1, altexp2, ..., altexpn not scalable

artur-sannikov commented 2 months ago

I don't think there are limitations from technical point of view. In one of MOFA vignettes they used 5 experiments.

TuomasBorman commented 2 months ago

That makes the implementation of this more difficult. Although one option could be altexp parameter that takes a vector as input.

One additional annoying thing is that you cannot specify which experiments and assays you feed to MOFA. So you have to remove additional assays before running MOFA.

That could be also be fixed with vector parameter.

create_mofa_from_MultiAssayExperiment(
    mae,
    exps = c(1, 3)
    assays = c("counts", "clr")
    altexps = c(NA, 1)
    )
RiboRings commented 2 months ago

Hi! In principle everything was implemented here: https://github.com/bioFAM/MOFA2/pull/144 Just waiting for a response for the past half year

TuomasBorman commented 2 months ago

Wow! You already did that :D

TuomasBorman commented 2 months ago

Hopefully the review proceeds soon

antagomir commented 2 months ago

I will bump them again. This is a pity as the approved the idea originally, before the PR.