Maaslin2 fails with random effects

MaAsLin2 Version ‘1.16.0’

I am analyzing a data set from a longitudinal study including 8 timepoints collected from 9 different individuals. When I run the model specifying only the fixed effect of “Time.Point” the results are as expected. However, when I run the model including the random effects of “SubjectID” the output contains duplicate rows for every feature; in each duplicate row the metadata and value are populated by the names of the variables “Time.Point” and "SubjectID, respectively. The coeff, stderr, pval, and qval are all “NA.” When I use the random effect as the fixed effect, it works as expected.

Code:

#this works
maaslin_res ← Maaslin2(
input_data = PRE,
input_metadata = sam_16S_PRE,
normalization = “CLR”,
transform = “None”,
output = “maaslin_PRE_output”,
fixed_effects = “SubjectID”,
)

#this works
maaslin_res ← Maaslin2(
input_data = PRE,
input_metadata = sam_16S_PRE,
normalization = “CLR”,
transform = “None”,
output = “maaslin_PRE_output”,
fixed_effects = c(“Time.Point”),
)

#does not work
maaslin_res ← Maaslin2(
input_data = PRE,
input_metadata = sam_16S_PRE,
normalization = “CLR”,
transform = “None”,
output = “maaslin_PRE_output”,
fixed_effects = c(“Time.Point”),
random_effects = c(“SubjectID”)
)

I tried the example from the tutorial and the same problem occurs using the random effects

#this works
fit_data ← Maaslin2(
input_data, input_metadata,‘demo_output’, transform = “AST”,
fixed_effects = c(‘diagnosis’, ‘dysbiosisnonIBD’,‘dysbiosisUC’,‘dysbiosisCD’, ‘antibiotics’, ‘age’),
normalization = ‘NONE’,
reference = ‘diagnosis,nonIBD’,
standardize = FALSE)

#does not work
fit_data ← Maaslin2(
input_data, input_metadata,‘demo_output’, transform = “AST”,
fixed_effects = c(‘diagnosis’, ‘dysbiosisnonIBD’,‘dysbiosisUC’,‘dysbiosisCD’, ‘antibiotics’, ‘age’),
random_effects = c(‘site’, ‘subject’),
normalization = ‘NONE’,
reference = ‘diagnosis,nonIBD’,
standardize = FALSE)

I have tried restarting R studio and reinstalling Maaslin2. Neither have resolved the issue. What is especially strange as I have been working with these data for weeks and the models with random effects have worked as expected. I do not think the problem is with my data because the example also does not run when random effects are included.

P.S. I know including example data and reproducible code would be useful, but I am relatively new to the forum and unsure how to do so. I am willing to include it if someone can point out how to include it in the post.

Thank you!

Hi @pcbarko,

Before I try and trouble shoot an older version of Maaslin2 could you try and install the latest verison (1.18.0) through either Bioconductor or Github. If updating Maaslin2 doesn’t solve your issue then could you paste your session information using sessionInfo() .

Thanks,
Jacob Nearing

@nearinj

I have tried multiple times to update/reinstall the Maaslin2 package, from both Bioconductor and GitHub. After each time I attempt to reinstall the package I check the version and it is always 1.15.1. I will try again after updating R and report back.

Thanks

Hi @pcbarko,

You may need to update R to 4.4.0 or higher. If you still cannot get it to work can you try and post the result of a sessionInfo()

It might point me to the right direction as I have tested your commands on the tutorial data that were not working and they run fine on my end.

Cheers,
Jacob