Skip to content

Create multimedia.qmd - #768

Open
YihanLiu4023 wants to merge 31 commits into
microbiome:develfrom
YihanLiu4023:patch-1
Open

Create multimedia.qmd#768
YihanLiu4023 wants to merge 31 commits into
microbiome:develfrom
YihanLiu4023:patch-1

Conversation

@YihanLiu4023

Copy link
Copy Markdown
Contributor

No description provided.

@antagomir antagomir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Check the suggestions and the following:

  1. increase support for the mia and (Tree)SummarizedExperiment methods when possible, this is very useful for compatibility with many other methods; I added suggestions. Also multimedia seems to support SE so this should be done.

  2. Let us try to avoid repetition in the code; this has now two almost identical parts. Shall we prepare example data that is readily usable for the examples?

  3. I am wondering if there would be a way to combine the two mediation chapters into one?

  4. If we consider these methods widely usable we should consider providing wrappers for the interpretation, summaries, and visualizations of the results; either as contributions to "multimedia" package, or into mia or some other pkg (doesn't matter which pkg as long as it works)

Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
@antagomir

Copy link
Copy Markdown
Member

Could you resolve the cases you have closed (from the "Resolve" buttons)?

@YihanLiu4023

Copy link
Copy Markdown
Contributor Author

Fixed most of the detailed comments, still working on the more genral ones like creating pkg. Will finish this asap

@antagomir

Copy link
Copy Markdown
Member

Can you resolve the completed suggestions above and confirm if this is ready to merge?

YihanLiu4023 and others added 2 commits August 30, 2025 02:36
Just fixed some minor inconsistence in the name of variables
@antagomir

Copy link
Copy Markdown
Member

To be checked in more detail before merge, regarding the following:

  1. May require additional wrapper functions to extract the relevant information from data objects more intuitively (but those should be in multimedia pkg or mia, so not sure if it is feasible to do as part of this PR - but if not, then it is unclear when this would take place).

  2. Are the examples now sufficiently short & concise (data cleaning steps usually avoided in OMA examples; some explanations could be added instead).

@YihanLiu4023

Copy link
Copy Markdown
Contributor Author

To be checked in more detail before merge, regarding the following:

  1. May require additional wrapper functions to extract the relevant information from data objects more intuitively (but those should be in multimedia pkg or mia, so not sure if it is feasible to do as part of this PR - but if not, then it is unclear when this would take place).
  2. Are the examples now sufficiently short & concise (data cleaning steps usually avoided in OMA examples; some explanations could be added instead).

Hi Leo, thank you for the suggestions. I have added some wrapper functions, especially to where you indicated. For the data cleanning steps, do you mean we can remove those part, and add some texts to explain instead?

@antagomir

Copy link
Copy Markdown
Member

The data cleaning part would work best if we include a suitable cleaned demo data in the R pkg, then we can skip the data cleaning steps in OMA. The problem is that if we could do this with every single method but then more than half of the book might easily be data cleaning examples, and this is also shifting the focus from the actual method to general data processing steps -> can we include demo data set/s in the multimedia, mia, or other pkg, or can we use already existing demo data sets?

@antagomir

Copy link
Copy Markdown
Member

Regarding the wrappers, we could see if we can include these in a package if they would be generally useful anyway.

@himelmallick

Copy link
Copy Markdown

Hi Leo – just wanted to quickly chime in here. This dataset is a special case where we don’t have a conventional, well-defined outcome for mediation analysis. Instead, the outcome is a dysbiosis score derived from taxonomic profiles, as described by Lloyd-Price et al. (2019), which, to my knowledge, hasn’t been implemented elsewhere. We are already drawing the data from curatedMetagenomicData, but creating the dysbiosis score is a necessary step to showcase the mediation analysis.

@antagomir

Copy link
Copy Markdown
Member

Thanks. I think that dysbiosis score could then stay there. Let's check @TuomasBorman feedback.

@TuomasBorman TuomasBorman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks very good! However, there are couple points to discuss.

This book is intended as teaching material to demonstrate specific analyses and tasks. The main focus is on the underlying ideas and concepts rather than implementation details. Therefore, the code is kept as simple as possible to achieve the intended outcomes. More polished analyses, including advanced plots, are better suited for workflow packages (we are also considering creating workflow package to showcase more complex analyses).

There are couple lengthy code chunks that do operations to results. Having these long chunks have opposite effect as readers are exhausted by the amount of code and they cannot focus on the main points. Everything that is not relevant for the main point should be removed even though plots or names would not be optimal.

Ideally, these wrappers will be implemented in a package, but of course it takes some time. At least, we should have plan to implement them. If we just leave it here, these will be never implemented as we are very busy with everything.

Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
@antagomir

Copy link
Copy Markdown
Member

Can you @YihanLiu4023 confirm when you're ready with the updates? Can you also press the "Update branch" button above to ensure that this PR is in sync with the latest devel branch.

@YihanLiu4023

Copy link
Copy Markdown
Contributor Author

Updated file submitted!

@antagomir antagomir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - some points to clarify still.

Overall this looks good but it will be essential to consider the following:

  1. Data cleaning operations should be either ignored, or readily cleaned demo data set should be used (it can be placed to one of our packages). Otherwise OMA would be primarily a data cleaning example collection..

  2. We need to check if any ready-made functionality is available to fetch and visualize results from mediation analyses. Now this is done with custom code. Maybe multimedia package has some utilities and if not, we should see if some tasks are so central that they should be standardized (either into multimedia package as contributed PR, or into mia).

Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
@antagomir

antagomir commented Jan 9, 2026

Copy link
Copy Markdown
Member

This seems nearly complete.

I picked the following points from above. Can you confirm this is OK @YihanLiu4023 ?

  1. Data cleaning operations: add and use readily cleaned demo data set for the examples. This will keep the examples more focused on the actual core point (mediation). If suitable demo data does not exist, we can add it in mia or another package (should be done before merging this but is straightfwd if the data is already prepared - we can help with this as necessary).
  2. Minor update on the visualisations as discussed above. Mostly just cite the multimedia homepage (and publication) for further guidance and examples.

@YihanLiu4023

Copy link
Copy Markdown
Contributor Author

This seems nearly complete.

I picked the following points from above. Can you confirm this is OK @YihanLiu4023 ?

  1. Data cleaning operations: add and use readily cleaned demo data set for the examples. This will keep the examples more focused on the actual core point (mediation). If suitable demo data does not exist, we can add it in mia or another package (should be done before merging this but is straightfwd if the data is already prepared - we can help with this as necessary).
  2. Minor update on the visualisations as discussed above. Mostly just cite the multimedia homepage (and publication) for further guidance and examples.

@RiboRings RiboRings left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more comments.

Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
Comment thread inst/pages/multimedia.qmd Outdated
@antagomir

Copy link
Copy Markdown
Member

@YihanLiu4023 can you resolve the remaining comments, then we approach completion?

@antagomir

Copy link
Copy Markdown
Member

@YihanLiu4023 kindly confirm when this is complete based on the feedback.

@antagomir

Copy link
Copy Markdown
Member

@RiboRings you commented, could you resolve responses that are ok?

@RiboRings

Copy link
Copy Markdown
Member

Hi @YihanLiu4023! I opened a pull request with some adjustments to your branch: YihanLiu4023#1

Please accept it so the changes are reflected here, and check that the code still runs correctly.

@RiboRings

RiboRings commented Aug 6, 2026

Copy link
Copy Markdown
Member

Two main considerations:

I am not getting what exactly is multi-omic about multimedia. In the chapter, microbiome and pathway experiments are analysed separately (with identical pipelines). In my understanding this isn't considered multi-omics since it isn't combining different omics into a single analysis.

If the idea is to study mediation using several features together (from a single omic type), multivariate would be the correct term to use here. But it should not be called multi-omic or multimodal.

Also, the chapter is relatively computationally intensive. To keep the book deployment short, reduce bootstrap iterations to the minimum where you still get similar results, and comment that ideally some N iterations should be run.

@YihanLiu4023

Copy link
Copy Markdown
Contributor Author

YihanLiu4023#1

Accepted!

@YihanLiu4023

Copy link
Copy Markdown
Contributor Author

Two main considerations:

I am not getting what exactly is multi-omic about multimedia. In the chapter, microbiome and pathway experiments are analysed separately (with identical pipelines). In my understanding this isn't considered multi-omics since it isn't combining different omics into a single analysis.

If the idea is to study mediation using several features together (from a single omic type), multivariate would be the correct term to use here. But it should not be called multi-omic or multimodal.

Also, the chapter is relatively computationally intensive. To keep the book deployment short, reduce bootstrap iterations to the minimum where you still get similar results, and comment that ideally some N iterations should be run.

  1. Yes, with species and pathway analysed separately, this is multivariate rather than multi-omic. I have renamed in all related part as "multivariate mediation". I also re-wrote the intro paragraph to describe high-dimensional mediation within a single omic layer.

  2. I reduced all B to 10 and added a note in the narrative: "To keep the book build time short, we use only B = 10 bootstrap iterations below; for real applications we recommend B >= 500 (ideally 1000 or more) to obtain stable percentile confidence intervals, so the CI widths shown here should be interpreted as illustrative rather than definitive."

@RiboRings

RiboRings commented Aug 9, 2026

Copy link
Copy Markdown
Member

Thanks a lot @YihanLiu4023!

This is ready from my side.

@antagomir @himelmallick @TuomasBorman any other thoughts on the last few comments above or just in general?

@YihanLiu4023

Copy link
Copy Markdown
Contributor Author

Thanks a lot @YihanLiu4023!

This is ready from my side.

@antagomir @himelmallick @TuomasBorman any other thoughts on the last few comments above or just in general?

Sounds great, thanks! I'm happy to work on any further comments.

@antagomir antagomir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you clarify the necessity of the second case (pathways)? At a quick look it seems very similar to the first part (taxa).

Comment thread inst/pages/multimedia.qmd
Comment thread inst/pages/multimedia.qmd
Comment thread inst/pages/multimedia.qmd
Comment thread inst/pages/multimedia.qmd

# Scale counts to [0, 1]
assay(se) <- assay(se) / 100

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TuomasBorman should we add this as ready-made demo data set? This processing code takes quite some space.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we should. This takes space, but also readers focusing capacity. Can we add it, e.g. to microbiomeDataSets

Comment thread inst/pages/multimedia.qmd
the outcome, but pathways abundances as the mediation variables instead of the
relative species abundance.

## Performing multivariate mediation analysis for pathways abundances {#sec-pathways-abundances}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part seems very much like repetition of what was already above.

Is this just a different data type (e.g. pathways), or is there a genuine difference so that it is justified to include this full second example workflow starting here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a discussion with Dr. Mallick with about the pathway section before, and we originally decided to include both of them because species-level analyses capture different aspects of microbiome data and can yield different mechanistic insights. But I totally understand your concerns and I'm double checking this with Dr. Mallick again.

@RiboRings

Copy link
Copy Markdown
Member

Would it make sense to combine the multimedia chapter with the existing mediation chapter? Then we can split it into a univariate and a multivariate section.

@antagomir

Copy link
Copy Markdown
Member

OK to me if this can be added fast - keeping in mind that our priority is to get this PR merged soon and we can then continue to reorganize material. @RiboRings and @YihanLiu4023 can you see how to do it unless there are other comments (@himelmallick @TuomasBorman )

@YihanLiu4023

YihanLiu4023 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Would it make sense to combine the multimedia chapter with the existing mediation chapter? Then we can split it into a univariate and a multivariate section.

I can remove the pathway section as Dr. Mallick also agrees on this to keep things simple. Please let me know whether we need to merge this part to the mediation chapter, do I need to pull request on that chapter?

@himelmallick

Copy link
Copy Markdown

I would suggest not merging with the current mediation chapter, as we will expand this one with Zentangler (https://github.com/himelmallick/Zentangler/) later on when it's on Bioconductor. This also keeps the two very different chapters separate: 1) single mediator, and 2) multiple mediators, with the latter being extensible to the multimodal case. Thanks, all, for the long discussion on this! We are almost there.

@antagomir

Copy link
Copy Markdown
Member

Ok with me.

@antagomir

Copy link
Copy Markdown
Member

@TuomasBorman yet to confirm

Comment thread inst/pages/multimedia.qmd
```

Building upon the concepts and workflows presented in the previous chapter on
mediation analysis, here we demonstrate how to perform **multivariate**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There could be a link to the previous chapter

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean adding a hyperlink to the previous chapter?

@TuomasBorman

Copy link
Copy Markdown
Contributor

Sorry for long delay. There has been little bit too much work going on. I am fine with separate chapters especially as Himel explained as there are major differences.

We can also in the future see how to improve the topic linking between chapters.

I would still remove the data wrangling related stuff and add the example dataset for instance to microbiomeDataSets.

@antagomir

antagomir commented Aug 23, 2026

Copy link
Copy Markdown
Member

I agree about the data.

microbiomeDataSets is a bit more work, and it may break examples when online connection is not stable (it fetches data online).

Could we add this data set as a standard package example data set in e.g. miaViz (we can later move this to multiomics pkg)?

The preparation scripts in the package should go to inst/scripts/, the data in data/, and its documentation in R/ (same file where other data documentation is located).

See here for more instructions on adding data in packages:
https://r-pkgs.org/data.html

Can you open the PR @YihanLiu4023 or how shall we proceed?

@YihanLiu4023

Copy link
Copy Markdown
Contributor Author

I agree about the data.

microbiomeDataSets is a bit more work, and it may break examples when online connection is not stable (it fetches data online).

Could we add this data set as a standard package example data set in e.g. miaViz (we can later move this to multiomics pkg)?

The preparation scripts in the package should go to inst/scripts/, the data in data/, and its documentation in R/ (same file where other data documentation is located).

See here for more instructions on adding data in packages: https://r-pkgs.org/data.html

Can you open the PR @YihanLiu4023 or how shall we proceed?

Yes, I can follow your instructions to add the data and script to miaViz. Please let me know whether to add it to mizViz or microbiomeDataSets finally, 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

Successfully merging this pull request may close these issues.

7 participants