Maaslin3 ggplot2 labels error

Hi, Ive recently been running into a ggplot2 error when running Maaslin - this makes it so that figures (except the summary figure) are no longer generated.

This is the error in question:

Error: ggplot2::labels object is invalid:

  • every label must be named.

Ive looked in my metadata and OTU table files and everything seems to be in order.

Any advice is appreciated, thanks!
Tommy

Hi Tommy,

The new ggplot version 4 deprecated something we were using in the plotting before. If you install the latest MaAsLin 3 it should work.

Will

Hi Will,

I am also facing the same issue with Tommy. I have the latest version of MaAsLin 3 installed with the latest version of R and Rstudio, following the tutorial.

I was going through the demo and playing around with the max_pngs parameter when I face the issue. I found that max_pngs=100 in README.md while it is 250 in the tutorial Wiki. I am getting the error message when I follow the number in tutorial Wiki (max_pngs=250). It seems that when the number is set to a certain threshold, the error message is shown after the outputs in the Rstudio console seem to show that association plots are being created. When I check the ./hmp2_output/figures directory, only summary_plot files in PNG and PDF are there. Linear and regression association plots are missing. I found that max_pngs=203 is the highest in order for the error not to show. So it seems that after a number of plots were generated, the script ran out of x and/or y axis to plot with and therefore, the error message. But that does not explain why there is no association plots in the output directory.

I did a little experiment with a single covariate (formula = ‘~ dysbiosis_state’) and max_pngs=203. Oddly, the total number of PNG files generated in the association_plots directory is 175.

I am not sure if downgrading ggplot2 package will help if version 4 deprecated something. Any thoughts?

Thank you.

Fabian.

Hi Fabian, what’s the actual version number of maaslin3 you’re installing? Also, it’s at least possible the total number of PNG files in the association plots directory is 175 even if you set the max at 203 if there weren’t 203 significant associations. Are you saying that the individual association plots work for some formulas but not others?

Hi Will, I have version 1.0.0 installed.

This is what I understand from your recent reply: If the maximum number of associations is less than max_pngs set in the parameters, then I should expect less plots than the set max_pngs.

Let me rephrase the issue for reproducibility. I was going through the tutorial. When I set max_pngs > 203, the ggplot::labels error was shown and I only get the summary plot in the output folder. I did not get any association plots at all although the outputs in the console said otherwise. Any idea what caused the error and missing association plots? I attached the log file for reference. In this case, max_pngs was set as 250.

maaslin3.txt (79.1 KB)

I am new to maaslin3 so I may have missed something.

Thank you.

If you run BiocManager::install("maaslin3"), do you get MaAsLin 1.0.2 rather than 1.0.0? 1.0.2 should have fixed the ggplot error. sessionInfo()$otherPkg$maaslin3 should show this:

git_branch: RELEASE_3_21
git_last_commit: d86be18
git_last_commit_date: 2025-10-12
Repository: Bioconductor 3.21
Date/Publication: 2025-10-13
Author: William Nickols [aut, cre] (ORCID:
< ORCID >), Jacob Nearing [aut]
Maintainer: William Nickols <willnickols@g.harvard.edu>
Built: R 4.5.1; ; 2025-10-15 23:06:50 UTC; unix

Thanks, Will. Everything works as expected now. Thought I had the latest version when I installed mid-October.