Difficulty running MaAsLin2 on microbe data

Hi all!

So I’m attempting to run MaAsLin2 as a way to explore the association between my microbial 16S data and some behavioural measures to work out associations with specific taxa. I’m having difficulty, however, as MaAslin2 doesn’t seem to like that all the variables I’m trying to use as “fixed effects” are continuous. Is MaAsLin2 capable of handling continuous covariates? Similar to a previous issue, it seems to try and split up my variable into “bins” and make a heatmap with different rows for every single value in the data.

This is my code:

fit_data = Maaslin2(
    input_data = otus, 
    input_metadata = behav, 
    output = "output", 
    normalization = "CLR",
   #USV duration is one of my behaviour measures, there are ~30 total
    fixed_effects = c("USV_DURR"))

thanks so much for your help!

Hi @mirpie,

MaAsLin can handle continuous variables. An easy way to check if MaAsLin is seeing them as continuous is to check if the plots generated scatter plots (for continuous variables), if you are getting boxplots then MaAsLin is “seeing” your data as categorical. If you are getting boxplots - have you checked the structure of your data (e.g. using str(metadata)) to make sure that R recognized the variable correctly?

I hope this helps - if not can you provide a dummy dataset so we can replicate the issue on our side?


Oh my goodness, I just realized when I read in the PDF it interpreted the numeric column as character. My bad for being sloppy.
As a side note, all punctuation/special characters have to be removed from covariate names for MaAsLin2 to recognize them! This was another error I received after fixing the initial issue.

Thanks again!