EBI-Metagenomics / notebooks

MGnify documentation and Jupyter Lab notebooks to support downstream analysis of MGnify data (EMBL-EBI's metagenomics platform)
https://ebi-metagenomics.github.io/notebooks
Apache License 2.0
14 stars 10 forks source link

Adding mia examples #50

Open SHillman836 opened 3 months ago

SHillman836 commented 3 months ago

So this is the newest EBI notebooks section. There were the following issues/questions that came up -

  1. The newer getTop() mia function wasn't working. So I had to use the GetTopFeatures() method. I'm on version 1.12.0 which I believe is the latest one

  2. Similarly, the newer rarefyAssay() function wasn't found, so I used subsampleCounts() instead.

  3. In the section titled "Comparative metagenomics at community level: Beta diversity" you need a mountford distance matrix for the adonis2 and betadisper methods. And when using the runMDS() method, you can't then convert the matrix that method produces to a dist object as it throws an error that it's not a square matrix. Or at least I wasn't sure how to do this. So I called the vegan package directly.

By the way, this PR includes the changes that Noah had made, I corrected one thing on one of his files, but other than that assumed his PR was correct.

@TuomasBorman @antagomir

antagomir commented 3 months ago

How does this PR relate to #49? Can we close #49 if it has been merged with this?

SHillman836 commented 3 months ago

How does this PR relate to #49? Can we close #49 if it has been merged with this?

Sorry didn't mean to close this have just reoopened it now. Yes we can close the other PR

SHillman836 commented 3 months ago

Some comments for starters.

@antagomir I was wondering - the "Fetch analyses metadata for a study" file that I pulled from the other PR - should I just remove it completely?

I think there was some confusion. It's basically a replica of this notebook - https://docs.mgnify.org/src/notebooks/R%20Examples/Fetch%20Analyses%20metadata%20for%20a%20Study.html

But the only difference is the last section where we convert to mia vs phyloseq. But I don't really see it being needed, because we have to do that anyway in the comparative metagenomics file.

I think Noah may have done the wrong notebook. Or maybe we're meant to do a mia version of both the comparative metagenomics guide and the fetching metadata guide? Let me know and then I'll make those grammar changes

I used what he did for section 1 of this guide - https://docs.mgnify.org/src/notebooks/R%20Examples/Comparative%20Metagenomics.html - but maybe that was the part we needed not the fetch metadata guide

SHillman836 commented 3 months ago

Ok herewego! Some more suggestions. The essential thing is to add more support for using the (Tree)SE ecosystem tools

Great thanks will do

antagomir commented 3 months ago

@TuomasBorman might add some comments but basically the notebook that you linked is based on the old version of MGnifyR. We recently rewrote the package to clean the code base and to add support for TreeSE/MAE.

Some function names might have changed, and there may be some other issues (argument names, changes in output formats how they are being processed). Make sure that the new workflow is tested with the latest Bioconductor development version of MGnifyR.

We support switching from phyloseq to TreeSE/MAE framework. Therefore it is justified to update (or rather, create a new version) of this notebook to show how to do this for TreeSE/MAE with the new upgraded MGnifyR package.

Imo. it is useful to have the two notebooks: this one that shows how to fetch data with MGnifyR and just get started with TreeSE/MAE (instead of phyloseq). And then the other one that focuses on the actual downstream analyses.

However if it starts to feel that there is too much overlap and these are better merged, we could think about that.

SHillman836 commented 3 months ago

@antagomir - I've just pushed a full updated - should be very close to finished now, it's quite polished. I'm sure there'll be a few changes though.