Maaslin3 model runs but produce output with no results

Hi there,

I have tried to run a differential abundance analysis using maaslin3 on my 16s rRNA data. I want to test differential abundance between two time points for the same 12 subjects.

I have tried both the Bioconductor version (1.0.2) and the latest GitHub version (0.99.18), but the model returns no results for features (empty columns for coef, p.vals, q.vals, etc in all_results.tsv), with errors like “No data points have the baseline factor level” and “All logistic values are the same“ even though my data appear correct.

This is the model setup:

set.seed(1)
fit_out <- maaslin3(input_data = normalized_otu,
                    input_metadata = metadata,
                    output = "output/maaslin_week3_6_absolute",
                    formula = '~ Week_aligned + reads + (1|ID)',
                    normalization = 'NONE',
                    transform = 'LOG',
                    augment = TRUE,
                    standardize = TRUE,
                    max_significance = 0.1,
                    median_comparison_abundance = FALSE,
                    median_comparison_prevalence = FALSE,
                    max_pngs = 250)

The input data

I am using absolute abundance in the normalized_otu matrix. The structure of the input data is as below.

> str(metadata)
'data.frame':	24 obs. of  4 variables:
 $ ID          : Factor w/ 14 levels "7302","7304",..: 12 6 13 11 12 1 9 14 9 8 ...
 $ Week        : Ord.factor w/ 6 levels "1"<"2"<"3"<"4"<..: 6 6 6 6 3 6 3 6 6 6 ...
 $ Week_aligned: Factor w/ 2 levels "3","6": 1 2 1 2 2 1 2 2 1 2 ...
 $ reads       : num  6503 46380 34994 34505 47088 ...
> str(normalized_otu)
 num [1:24, 1:8] 2.33e+10 2.66e+10 1.67e+10 3.23e+10 2.10e+10 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:24] "7317_6" "7309_6" "7318_6" "7316_6" ...
  ..$ : chr [1:8] "Firmicutes" "Actinobacteria" "Bacteroidetes" "Proteobacteria" ...

Some of the troubleshooting attempted

  • Checked that rownames of OTU table and metadata match and are in the same order.
  • Confirmed Week_aligned is a factor with levels c(“3”, “6”), both groups have 12 samples.
  • Added a pseudo-count to OTU table before log transform.
  • Tried formula with only Week_aligned, with and without normalization/transform.
  • When I try more minimal models or default settings, I experience the same issue.
  • Updated all dependencies and packages.
  • Installed both Bioconductor and GitHub versions of Maaslin3.

Session info

R version 4.5.1 (2025-06-13 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows Server 2022 x64 (build 20348)

Matrix products: default
  LAPACK version 3.12.1

locale:
[1] LC_COLLATE=Danish_Denmark.utf8  LC_CTYPE=Danish_Denmark.utf8    LC_MONETARY=Danish_Denmark.utf8 LC_NUMERIC=C                    LC_TIME=Danish_Denmark.utf8    

time zone: Europe/Berlin
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] phyloseq_1.52.0     kableExtra_1.4.0    ggpubr_0.6.2        GMHmicrobiome_0.1.0 lubridate_1.9.4     forcats_1.0.1       stringr_1.5.2       dplyr_1.1.4         purrr_1.1.0         readr_2.1.5         tidyr_1.3.1        
[12] tibble_3.3.0        ggplot2_4.0.0       tidyverse_2.0.0     maaslin3_0.99.18   

loaded via a namespace (and not attached):
  [1] Rdpack_2.6.4                    pbapply_1.7-4                   permute_0.9-8                   rlang_1.1.6                     magrittr_2.0.4                  ade4_1.7-23                     matrixStats_1.5.0              
  [8] compiler_4.5.1                  mgcv_1.9-3                      systemfonts_1.3.1               vctrs_0.6.5                     reshape2_1.4.4                  pkgconfig_2.0.3                 crayon_1.5.3                   
 [15] fastmap_1.2.0                   backports_1.5.0                 XVector_0.48.0                  rmarkdown_2.30                  tzdb_0.5.0                      nloptr_2.2.1                    UCSC.utils_1.4.0               
 [22] xfun_0.53                       GenomeInfoDb_1.44.3             jsonlite_2.0.0                  biomformat_1.36.0               rhdf5filters_1.20.0             DelayedArray_0.34.1             Rhdf5lib_1.30.0                
 [29] BiocParallel_1.42.2             cluster_2.1.8.1                 broom_1.0.10                    parallel_4.5.1                  R6_2.6.1                        stringi_1.8.7                   RColorBrewer_1.1-3             
 [36] boot_1.3-32                     pkgload_1.4.1                   car_3.1-3                       GenomicRanges_1.60.0            Rcpp_1.1.0                      SummarizedExperiment_1.38.1     iterators_1.0.14               
 [43] knitr_1.50                      IRanges_2.42.0                  igraph_2.2.1                    Matrix_1.7-4                    splines_4.5.1                   timechange_0.3.0                tidyselect_1.2.1               
 [50] rstudioapi_0.17.1               dichromat_2.0-0.1               abind_1.4-8                     yaml_2.3.10                     vegan_2.7-2                     TreeSummarizedExperiment_2.16.1 codetools_0.2-20               
 [57] lattice_0.22-7                  plyr_1.8.9                      Biobase_2.68.0                  treeio_1.32.0                   withr_3.0.2                     S7_0.2.0                        evaluate_1.0.5                 
 [64] survival_3.8-3                  getopt_1.20.4                   xml2_1.4.1                      Biostrings_2.76.0               pillar_1.11.1                   MatrixGenerics_1.20.0           carData_3.0-5                  
 [71] foreach_1.5.2                   stats4_4.5.1                    reformulas_0.4.1                generics_0.1.4                  S4Vectors_0.46.0                hms_1.1.4                       scales_1.4.0                   
 [78] tidytree_0.4.6                  minqa_1.2.8                     glue_1.8.0                      lazyeval_0.2.2                  tools_4.5.1                     data.table_1.17.8               lme4_1.1-37                    
 [85] ggsignif_0.6.4                  fs_1.6.6                        rhdf5_2.52.1                    grid_4.5.1                      optparse_1.7.5                  ape_5.8-1                       rbibutils_2.3                  
 [92] colorspace_2.1-2                SingleCellExperiment_1.30.1     nlme_3.1-168                    GenomeInfoDbData_1.2.14         Formula_1.2-5                   cli_3.6.5                       rappdirs_0.3.3                 
 [99] textshaping_1.0.4               S4Arrays_1.8.1                  viridisLite_0.4.2               svglite_2.2.2                   gtable_0.3.6                    logging_0.10-108                rstatix_0.7.3                  
[106] yulab.utils_0.2.1               digest_0.6.37                   BiocGenerics_0.54.1             SparseArray_1.8.1               farver_2.1.2                    multtest_2.64.0                 htmltools_0.5.8.1              
[113] lifecycle_1.0.4                 httr_1.4.7                      MASS_7.3-65  

I have not tried to post an issue before, so if you need more info, please let me know.

Thank you!

maaslin3_log.txt (13.9 KB)

Hi,

  1. “All logistic values are the same” means that all your abundance values were non-zero in the data. You mentioned adding a psuedo-count to the OTUs before log transformation. Did you always do this or just as a test? Adding the pseudo-count to everything would cause this issue because then there would be no zero values in the data.
  2. To make sure there’s not a variable conversion issue, if you rename your week variables so they’re week_3 and week_6, does the “No data points have the baseline factor level” go away? And are you sure the variable doesn’t have any other factor levels besides what’s actually present in the column?

Will

Hi Will,

Thank you for your quick response.

  1. Adding pseudo-count to the OTUs was just a test. However, at the moment I’m trying to test on phylum level and there are therefore some phyla that have all non-zero values, hence, that error makes sense.
  2. The “No data points have the baseline factor level” is still there if I rename the values of my group variable (Week_aligned) to week_3 and week_6. The variable does not have other factor levels besides those two.

I have tried using lme4 to run lmer on the same data, just one phylum at a time, and this runs without a problem.

I created a data frame with random values as the normalized_otu matrix I use. There are no non-zero values here, but my issue is with the test on abundance, and I get the same error when using this data:

structure(c(0.2655086631421, 0.37212389963679, 0.572853363351896, 
0.908207789994776, 0.201681931037456, 0.898389684967697, 0.944675268605351, 
0.660797792486846, 0.62911404389888, 0.0617862704675645, 0.205974574899301, 
0.176556752528995, 0.687022846657783, 0.384103718213737, 0.769841419998556, 
0.497699242085218, 0.717618508264422, 0.991906094830483, 0.380035179434344, 
0.777445221319795, 0.934705231105909, 0.212142521282658, 0.651673766085878, 
0.125555095961317, 0.267220668727532, 0.386114092543721, 0.0133903331588954, 
0.382387957070023, 0.86969084572047, 0.34034899668768, 0.482080115471035, 
0.599565825425088, 0.493541307048872, 0.186217601411045, 0.827373318606988, 
0.668466738192365, 0.79423986072652, 0.107943625887856, 0.723710946040228, 
0.411274429643527, 0.820946294115856, 0.647060193819925, 0.78293276228942, 
0.553036311641335, 0.529719580197707, 0.789356231689453, 0.023331202333793, 
0.477230065036565, 0.7323137386702, 0.692731556482613, 0.477619622135535, 
0.8612094768323, 0.438097107224166, 0.244797277031466, 0.0706790471449494, 
0.0994661601725966, 0.31627170718275, 0.518634263193235, 0.662005076417699, 
0.406830187188461, 0.912875924259424, 0.293603372760117, 0.459065726259723, 
0.332394674187526, 0.65087046707049, 0.258016780717298, 0.478545248275623, 
0.766310670645908, 0.0842469143681228, 0.875321330036968, 0.339072937844321, 
0.839440350187942, 0.34668348915875, 0.333774930797517, 0.476351245073602, 
0.892198335845023, 0.864339470630512, 0.389989543473348, 0.777320698834956, 
0.960617997217923, 0.434659484773874, 0.712514678714797, 0.399994368897751, 
0.325352151878178, 0.757087148027495, 0.202692255144939, 0.711121222469956, 
0.121691921027377, 0.245488513959572, 0.14330437942408, 0.239629415096715, 
0.0589343772735447, 0.642288258532062, 0.876269212691113, 0.778914677444845, 
0.79730882588774, 0.455274453619495, 0.410084082046524, 0.810870242770761, 
0.604933290276676, 0.654723928077146, 0.353197271935642, 0.270260145887733, 
0.99268406117335, 0.633493264438584, 0.213208135217428, 0.129372348077595, 
0.478118034312502, 0.924074469832703, 0.59876096714288, 0.976170694921166, 
0.731792511884123, 0.356726912083104, 0.431473690550774, 0.148211560677737, 
0.0130775754805654, 0.715566066093743, 0.103184235747904, 0.446284348610789, 
0.640101045137271, 0.991838620044291, 0.495593577856198, 0.484349524369463, 
0.173442334868014, 0.754820944508538, 0.453895489219576, 0.511169783771038, 
0.207545113284141, 0.228658142732456, 0.595711996313184, 0.57487219828181, 
0.0770643802825361, 0.0355405795853585, 0.642795492196456, 0.928615199634805, 
0.598092422354966, 0.560900748008862, 0.526027723914012, 0.985095223877579, 
0.507641822332516, 0.682788078673184, 0.601541217649356, 0.238868677755818, 
0.258165926672518, 0.729309623362496, 0.452570831403136, 0.175126768415794, 
0.746698269620538, 0.104987640399486, 0.864544949028641, 0.614644971676171, 
0.557159538846463, 0.328777319053188, 0.453131445450708, 0.500440972624347, 
0.180866361130029, 0.529630602803081, 0.0752757457084954, 0.277755932649598, 
0.212699519237503, 0.284790480975062, 0.895094102947041, 0.4462353233248, 
0.779984889784828, 0.880619034869596, 0.413124209502712, 0.0638084805104882, 
0.335487491684034, 0.723725946620107, 0.337615333497524, 0.630414122482762, 
0.840614554006606, 0.856131664710119, 0.39135928102769, 0.380493885604665, 
0.895445425994694, 0.644315762910992, 0.741078648716211, 0.605303446529433, 
0.903081611497328, 0.293730155099183, 0.19126010988839, 0.886450943304226, 
0.503339485730976, 0.877057543024421, 0.189193622441962, 0.758103052387014, 
0.724498892668635, 0.943724818294868, 0.547646587016061, 0.711743867723271, 
0.388905099825934), dim = c(24L, 8L), dimnames = list(c("7317_6", 
"7309_6", "7318_6", "7316_6", "7317_3", "7302_6", "7314_3", "7320_6", 
"7314_6", "7313_6", "7320_3", "7305_6", "7304_3", "7316_3", "7313_3", 
"7308_3", "7304_6", "7309_3", "7308_6", "7302_3", "7307_6", "7307_3", 
"7305_3", "7318_3"), c("Firmicutes", "Actinobacteria", "Bacteroidetes", 
"Proteobacteria", "Synergistetes", "Verrucomicrobia", "Tenericutes", 
"Candidatus_Saccharibacteria")))


My metadata looks like this (I’m not using the Week variable for now):

structure(list(ID = structure(c(12L, 6L, 13L, 11L, 12L, 1L, 9L, 14L, 9L, 8L, 14L, 3L, 2L, 11L, 8L, 5L, 2L, 6L, 5L, 1L, 4L, 4L, 3L, 13L), levels = c("7302", "7304", "7305", "7307", "7308", "7309", "7311", "7313", "7314", "7315", "7316", "7317", "7318", "7320"), class = "factor"), Week = structure(c(6L, 6L, 6L, 6L, 3L, 6L, 3L, 6L, 6L, 6L, 3L, 6L, 3L, 3L, 3L, 3L, 6L, 3L, 6L, 3L, 6L, 3L, 3L, 3L), levels = c("1", "2", "3", "4", "5", "6"), class = c("ordered", "factor")), Week_aligned = structure(c(1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L), levels = c("week_3", "week_6"), class = "factor"), reads = c(6503, 46380, 34994, 34505, 47088, 40064, 43427, 56942, 6634, 32363, 41502, 60019, 61668, 64298, 63394, 59776, 46109, 71950, 48017, 66663, 55290, 36987, 36211, 66644)), row.names = c("7317_6", "7309_6", "7318_6", "7316_6", "7317_3", "7302_6", "7314_3", "7320_6", "7314_6", "7313_6", "7320_3", "7305_6", "7304_3", "7316_3", "7313_3", "7308_3", "7304_6", "7309_3", "7308_6", "7302_3", "7307_6", "7307_3", "7305_3", "7318_3"), class = "data.frame")

/Malte

Hi Malte,

Can you try converting the random effect levels to explicit strings (e.g. something like appending “ID_” to all of them). I want to make sure they’re not being picked up as numeric values in the random effect, which could cause errors. It that’s still erroring, would you mind private forum messaging me or emailing me (willnickols@g.harvard.edu) a 10x10 snippet of the annotations and metadata along with the maaslin3 call you’re making that reproduces the issue so I can troubleshoot on my end. I still suspect there’s something silently wrong with the format, but it’s hard to tell without running it.

WIll

Hi Will,

Thanks again for taking the time to help troubleshooting!

I finally found a solution. I removed the Week variable from my metadata, and now it works. I guess that for some reason, the Week variable was being used when running the model, even though I used Week_aligned in the call. It was strange because when I made your suggested edits to the Week_aligned variable (e.g., adding week_ before the week number), they showed up in the results data frame, so I didn’t suspect that the week variable was causing problems. Anyhow, removing it solved the problem.

Best, Malte

Hmm, go figure. Well, glad it worked!