microbiomeMarker
microbiomeMarker copied to clipboard
Random effect syntax e.g. using `run_ancom`
Thanks for developping this tool.
Some of the methods supports mixed model effects e.g., ANCOM.
How is it possible to specify the random factor using microbiomeMarker?
main_var = "delivery"; p_adj_method = "BH"; alpha = 0.05 adj_formula = "month"; rand_formula = "~ month | studyid" lme_control = list(maxIter = 100, msMaxIter = 100, opt = "optim")
res = ANCOM(feature_table, meta_data, struc_zero, main_var, p_adj_method, alpha, adj_formula, rand_formula, lme_control)
I tried the following:
require(microbiomeMarker)
data(enterotypes_arumugam)
ps <- phyloseq::subset_samples(
enterotypes_arumugam,
Enterotype %in% c("Enterotype 3", "Enterotype 2")
)
run_ancom(ps, group = "Enterotype", formula = "~ 1 | Gender",
)
Which led to the following error:
Error: $ operator is invalid for atomic vectors
In addition: Warning message:
return the original feature table.
Thanks
@fconstancias Thanks for your question. Argument confounders
is used to specify the confouding variables. e.g.
run_ancom(ps, group = "Enterotype", confounders = "Gender")
Hi @yiluheihei,
Thanks for your answer. From the ANCOM package the approach can handle both:
-
adj_formula: Character string representing the formula for adjustment (see example)
-> confounders -
rand_formula: Character string representing the formula for random effects in lme. For details, see ?lme
Any way to specify both in microbiomeMarker::run_ancom()
?
Thanks
Hi @yiluheihei,
Thanks for your answer. From the ANCOM package the approach can handle both:
adj_formula: Character string representing the formula for adjustment (see example)
-> confoundersrand_formula: Character string representing the formula for random effects in lme. For details, see ?lme
Any way to specify both in
microbiomeMarker::run_ancom()
?Thanks
Currently, microbiomMarker only supports adjustment formula by setting the argument confounders
.