Error while running MaAsLin: invalid 'lazy' to 'R_sparse_transpose'

MaAsLin version: 1.12.0
R version 4.2.3 (2023-03-15 ucrt)


I have been trying to run MaAsLin on some microbiome data and during the model fitting step, I kept encountering the following problem, after every feature:

Error in t(,, lapply(seq_along(blist),  : 
  invalid 'lazy' to 'R_sparse_transpose'

I thought it may have something to do with my data, but when I tried running the demo, I had the exact same problem. I am attaching the log file from the demo run here.
maaslin2.log.txt (16.8 KB)

After a long search online, I think it may be due to some package conflicts and more specifically due to phylloseq (see here). I have tried following some of the instructions here (restarted the R sessions, tried to force update some packages, detached others), but nothing has worked so far.

If anybody has any ideas, it would be greatly appreciated!

Hi @Marios_Fokaefs

Hope things are going well.

It does indeed sound like you are running into some package issues. I would highly recommend trying to reinstall Maaslin2 from GitHub using:


If that doesn’t solve the issue it is difficult to say what package is causing this conflict. Is it possible to test Maaslin2 on a different R installation?

Jacob Nearing

My solution was to reinstall phyloseq and it worked. I have R v4.2.0 and MaAsLin v.1.15.1

remotes::install_github(“joey711/phyloseq”, force = TRUE)

I confirm. I had to reinstall all dependent packages with the most appropriate version, but in the end I believe phylloseq was the one causing the conflict.