microbiomeMarker icon indicating copy to clipboard operation
microbiomeMarker copied to clipboard

Random effect syntax e.g. using `run_ancom`

Open fconstancias opened this issue 2 years ago • 3 comments

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 avatar Jun 02 '22 12:06 fconstancias

@fconstancias Thanks for your question. Argument confounders is used to specify the confouding variables. e.g.

run_ancom(ps, group = "Enterotype", confounders = "Gender")

yiluheihei avatar Jun 16 '22 06:06 yiluheihei

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

fconstancias avatar Jun 16 '22 07:06 fconstancias

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

Currently, microbiomMarker only supports adjustment formula by setting the argument confounders.

yiluheihei avatar Jun 16 '22 08:06 yiluheihei