Dear bioBakery team/ users,
I am analyzing some 16S metabarcoding data assessing the effect of different treatments (6 + control levels) on mouse microbiota using in the vitro fermentation system. Since fermentations (i.e., experiment) were run using different donor microbiota and several times I would like to ‘remove’ the donor effect (i.e., experiment) which explains most of the variation in the community [PERMANOVA R2experiment > R2 treatement] to combine the datasets and focus on the treatment and use the experiment as replicates.
I followed the MMUPHin tutorial[Performing meta-analyses of microbiome studies with MMUPHin] and used the adjust_batch function easily.
fit_adjust_batch <- MMUPHin::adjust_batch(feature_abd = ps %>% otu_table(), batch = "experiment", covariates = "treatment", data = ps %>% sample_data() %>% data.frame(), control = list(verbose = TRUE))
According to PERMANOVA using Aitchinson distance MMUPHin::adjust_batch slightly removed some expeirment related variation (57% vs 61% initially) maintaining a treatment-related source of variation (4.9% vs 4.7% initially).
I am wondering what determine the hability of MMUPHin::adjust_batch to remove the batch related sources of variations.
I am also interested in applying MMUPHin::lm_meta on the same dataset but got the following error:
Warning in check_batch(df_batch[[batch]], min_n_batch = 2) : Batch variable is not a factor as provided and will be converted to one. Found 2 batches Error in paste(lvl_batch[ind_exposure & !ind_exposure_cat], collapse = ", ") : object 'lvl_batch' not found
Any idea how to solve this? Thanks a ton.
Enclosed some PCoA / PERMANOVA / heatmap.