"Error in if (x == y) x else gsub(x, "", y) : missing value where TRUE/FALSE needed" with Maaslin2 analysis

Hello all,
I was in the middle of doing sets of analyses with the maaslin2 workflow and suddenly ran across a bug. For background context, this is the code I have been using, with various forms of having or not having random effects added:
lm_w4trt ← Maaslin2(
input_data = table_tsv,
input_metadata = meta_tsv,
output = “analysis_files/maaslin2/w4trt”,
normalization = ‘NONE’,
analysis_method = ‘ZINB’,
transform = ‘NONE’,
fixed_effects = c(“treatment”),
reference = c(“treatment”, “Placebo”),
save_models = TRUE,
save_scatter = TRUE)

The code was running and working fine one day and getting good results. I installed the ANCOMBC package to look at other analysis workflows. I then went back the next day to finish the last few data sets of maaslin analysis. The analysis seemed to go quickly through the model fittings for each taxa feature and then showed this error message after fitting the last feature:
Error in if (x == y) x else gsub(x, “”, y) :
missing value where TRUE/FALSE needed
Looking into this, it was suggesting that there was an issue with the meta or table files. However, they were the same files that was working previously, making me believe it was due to installing the other package and its dependencies, updates of other packages. Being relatively new to using R, I was not expecting this to cause issues with the function of other packages. I have gone through numerous attempts of double checking my files, I have uninstalled ANCOMBC and its dependencies, and did multiple attempts of uninstalling maaslin2, its dependencies and then reinstalling and I am still coming up with this same error code. I have been using R 4.4.1. Really hope someone can help find a solution to this. Thanks

Hi,

If you haven’t already, try opening a new R session with MaAsLin 2 to make sure global environmental variables/package loads aren’t causing an issue even if you’ve uninstalled MaAsLin 2 or ANCOMBC.

This is a relatively common error in MaAsLin, and I think it typically comes from unexpected metadata columns. Check that your metadata table has column names without strange characters and replace them if so. Also, in reference = c(“treatment”, “Placebo”), the comma should be inside the parentheses like: reference = c(“treatment,Placebo”).

Let me know if some combination of these changes work.

Will