# MaAsLin3 with estimated microbial load

**URL:** <https://forum.biobakery.org/t/maaslin3-with-estimated-microbial-load/7668>\
**Category:** MaAsLin\
**Created:** [December 18, 2024, 5:49am UTC](https://forum.biobakery.org/t/maaslin3-with-estimated-microbial-load/7668 "2024-12-18T05:49:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![salim](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@salim](https://forum.biobakery.org/u/salim)\
**Post date:** [December 18, 2024, 5:49am UTC](https://forum.biobakery.org/t/maaslin3-with-estimated-microbial-load/7668/1 "2024-12-18T05:49:20Z")

</div>

Hi,

I’m curious about the compositionality correction in MaAsLin3.  
The documentation only mentioned using either experimental methods (e.g., spike-in) and the median-based computational method.

Have you checked MaAsLin3 behavior when using estimated microbial load described in [this paper](https://doi.org/10.1016/j.cell.2024.10.022)?  
If I wanted to test it myself, which would be better, include is as a continuous covariate similar to read depths or use it as an input to `unscaled_abundance`?

---

<div class="post-metadata">

**Author:** ![WillNickols](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/willnickols/32/3223_2.png) [@WillNickols](https://forum.biobakery.org/u/WillNickols)\
**Post date:** [December 18, 2024, 11:42am UTC](https://forum.biobakery.org/t/maaslin3-with-estimated-microbial-load/7668/2 "2024-12-18T11:42:32Z")

</div>

Hi salim,

We haven’t checked this yet, though it’s on our to-do list. After looking briefly at their github, I think the right way would be to use the qmp option like `MLP(input, "motus25", "metacardis", "qmp")` and then input this abundance table with `normalization = 'NONE'`. This is essentially the same thing we did in [our evaluations](https://doi.org/10.1101/2024.12.13.628459) since the datasets in the absolute abundance studies were already scaled to be on the absolute scale.

Will

---

<div class="post-metadata">

**Author:** ![salim](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@salim](https://forum.biobakery.org/u/salim)\
**Post date:** [December 20, 2024, 3:22am UTC](https://forum.biobakery.org/t/maaslin3-with-estimated-microbial-load/7668/3 "2024-12-20T03:22:02Z")

</div>

Hi Will

Thanks for the quick reply and the advice.  
I’ll try it with my own data and see how it goes.

P.S. On another topic, when I’m running MaAsLin3 with `plot_associations = TRUE`, which is the default, it outputs huge `.rds` files. I think it’s a similar problem reported in [this SO thread](https://stackoverflow.com/questions/42230920/saverds-inflating-size-of-object), any way to bypass this while still producing the plots? Maybe by saving the source data.frame rather than the ggplot objects?  
If you think I should open another topic to discuss this issue, please mention it.

---

<div class="post-metadata">

**Author:** ![WillNickols](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/willnickols/32/3223_2.png) [@WillNickols](https://forum.biobakery.org/u/WillNickols)\
**Post date:** [December 20, 2024, 4:13am UTC](https://forum.biobakery.org/t/maaslin3-with-estimated-microbial-load/7668/4 "2024-12-20T04:13:15Z")

</div>

There are a few parameters that might already solve this issue. First, you can choose to not save the models with `save_models = FALSE`, which stops saving the per-feature model fits (related to that thread). You can also set `max_pngs = 30` if it’s currently higher. Do either of those reduce your RDS file size?

---

<div class="post-metadata">

**Author:** ![salim](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@salim](https://forum.biobakery.org/u/salim)\
**Post date:** [December 20, 2024, 4:50am UTC](https://forum.biobakery.org/t/maaslin3-with-estimated-microbial-load/7668/5 "2024-12-20T04:50:16Z")

</div>

I still encountered this problem with `save_models = FALSE`.  
Looking at the source code in GitHub, it looks like `maaslin_plot_results` doesn’t take `save_models` as an argument.

Limiting the number of plots with `max_pngs = 10` doesn’t help either.

---

<div class="post-metadata">

**Author:** ![WillNickols](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/willnickols/32/3223_2.png) [@WillNickols](https://forum.biobakery.org/u/WillNickols)\
**Post date:** [December 20, 2024, 9:33am UTC](https://forum.biobakery.org/t/maaslin3-with-estimated-microbial-load/7668/6 "2024-12-20T09:33:15Z")

</div>

Ah, I didn’t realize you were just using the plotting function. Can you send the function with arguments you were running?

---

<div class="post-metadata">

**Author:** ![WillNickols](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/willnickols/32/3223_2.png) [@WillNickols](https://forum.biobakery.org/u/WillNickols)\
**Post date:** [December 21, 2024, 11:21pm UTC](https://forum.biobakery.org/t/maaslin3-with-estimated-microbial-load/7668/7 "2024-12-21T23:21:51Z")

</div>

Update: I was doing some testing today and realized this was an unintended result from a recent pull request. Working to fix it…

---

<div class="post-metadata">

**Author:** ![WillNickols](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/willnickols/32/3223_2.png) [@WillNickols](https://forum.biobakery.org/u/WillNickols)\
**Post date:** [December 23, 2024, 5:45pm UTC](https://forum.biobakery.org/t/maaslin3-with-estimated-microbial-load/7668/8 "2024-12-23T17:45:35Z")

</div>

Okay - this should be fixed. There’s now a parameter `save_plots_rds` which is `FALSE` by default but can be turned on to save the plots as RDS files. Otherwise, they won’t be saved to avoid these large files.

---

<div class="post-metadata">

**Author:** ![salim](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@salim](https://forum.biobakery.org/u/salim)\
**Post date:** [December 24, 2024, 1:39pm UTC](https://forum.biobakery.org/t/maaslin3-with-estimated-microbial-load/7668/9 "2024-12-24T13:39:18Z")

</div>

Sorry for the late reply.

I’ve reinstalled maaslin3 and confirmed that setting `save_plot_rds = FALSE` and `plot_associations = TRUE` outputs the association PNG without the large RDS.  
Thanks for the quick response.
