For the answer 1, I would like to double check if I understand correctly. I have two levels in treatment : TrtA (reference) and TrtB. I have three levels in time: day0 (reference), day10, day22. If I build a model as below:
DAmodel1= maaslin3(input_data = otu_df,
input_metadata = metadata,
output = “output_damodel1”,
formula = ‘~ Treatment + Time + Treatment:Time + (1|SubjectID)’,
normalization = “TSS”,
transform = “LOG”,
reference = c(“Treatment,TrtA”, ‘Time,day0’),
standardize = FALSE,
augment = TRUE,
min_prevalence = 0.1,
max_significance = 0.1,
median_comparison_abundance = TRUE,
median_comparison_prevalence = FALSE,
max_pngs = 250)
For the main treatment effects: It compared TrtB with the reference TrtA across all the times? You mentioned [the treatment groups are tested against the baseline treatment] for the baseline time group. It makes me a little confused, the baseline time group here is only day0 group or regardless the different time points?
For the main time effects: My understanding is to compare day10 with day0 and compare day22 with day0 regardless different treatments here.
For the interaction effects: Compare TrtA_day10 vs TrtA_day0, TrtA_day22 vs TrtA_day0, TrtB_day10 vs TrtB_day0, and TrtB_day22 vs TrtB_day0, right?
For the model2, my R codes are below: Based on the levels of treatments and times, I have six different levels in Trt_time.
DAmodel2= maaslin3(input_data = otu_df,
input_metadata = metadata,
output = “output_damodel2”,
formula = ‘~ Trt_time + (1|SubjectID)’,
reference = c(‘Trt_time,TrtA_day0’),
normalization = “TSS”,
transform = “LOG”,
standardize = FALSE,
augment = TRUE,
min_prevalence = 0.1,
max_significance = 0.1,
median_comparison_abundance = TRUE,
median_comparison_prevalence = FALSE,
max_pngs = 250)
contrast_mat ← matrix(c(
1, -1, 0, 0, 0, 0, # TrtA_day0 vs. TrtB_day0
0, 0, 1, -1, 0, 0, # TrtA_day10 vs. TrtB_day10
0, 0, 0, 0, 1, -1, # TrtA_day22 vs. TrtB_day22
0, 1, 0, -1, 0, 0, # TrtB_day0 vs. TrtB_day10
0, 1, 0, 0, 0, -1 # TrtB_day0 vs. TrtB_day22
), ncol = 6, byrow = TRUE)
colnames(contrast_mat) ← c(“Trt_timeTrtA_day0”, “Trt_timeTrtB_day0”,
“Trt_timeTrtA_day10”, “Trt_timeTrtB_day10”,
“Trt_timeTrtA_day22”, “Trt_timeTrtB_day22”)
rownames(contrast_mat) ← c(“Baseline_Comparison”,
“10day_Comparison”,
“22day_Comparison”,
“TrtB_day0_vs_4day”,
“TrtB_day0_vs_22day”)
contrast_out ← maaslin_contrast_test(maaslin3_fit = DAmodel2,
contrast_mat = contrast_mat)
significant_abundance_results ← contrast_out$fit_data_abundance$results %>%
filter(qval_individual <= 0.05 | qval_joint <= 0.05) #####???Got 0 rows. All the q and p values are NAs, same for the prevalence results.