We seem to get very different results using a random effect in Maaslin2 vs Maaslin3. In Maaslin2, it had absolutely no effect on the results. In Maaslin3, it caused most of the differences observed for fixed effects to disappear - not just lower P values but pretty much no differences seen on the Maaslin3 summary graph (versus what we see without the random effect). What might be the reason? Please see code for both below - this is our first time using Maaslin, so we might be doing something wrong.
In this data, we analyze piglet microbiotas and try to use their dams (sows) as a random effect.
ps_analy$exp_group <- factor(ps_analy$exp_group, levels = c('C', 'P', 'T'))
ps_analy$sex <- factor(ps_analy$sex, levels = c('M', 'F'))
ps_analy$sow <- as.factor(ps_analy$sow)
mas_1 <- Maaslin2(input_data = data.frame(otu_table(ps.taxa.rel)),
input_metadata = data.frame(sample_data(ps_analy)),
output = "maaslin2_piglets",
min_abundance = 0.0001,
min_prevalence = 0.1,
normalization = "TSS",
transform = "LOG",
analysis_method = "LM",
max_significance = 0.1,
fixed_effects = c("exp_group","sex","reads"),
random_effects = c("ps_analy$sow"),
reference = c("exp_group,C"),
correction = "BH",
standardize = FALSE,
cores = 1)
fit_out <- maaslin3(input_data = data.frame(otu_table(ps.taxa.rel)),
input_metadata = data.frame(sample_data(ps_analy)),
output = 'maaslin3_piglets',
min_abundance = 0.0001,
min_prevalence = 0.1,
formula = '~exp_group+sex+reads+(1|sow)',
normalization = 'TSS',
transform = 'LOG',
augment = TRUE,
standardize = TRUE,
max_significance = 0.1,
median_comparison_abundance = TRUE,
median_comparison_prevalence = FALSE,
max_pngs = 100,
cores = 1,
save_models = TRUE)