Fit one linear mixed-effects model per CpG for each phenotype requested in the object returned by prepareMethylationGLMM_T1T2Data().

fitMethylationGLMM_T1T2Models(
  preparedData,
  nCores = 1L,
  libPath = NULL,
  lmeLibs = "lme4,lmerTest",
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_methylationGLMM_T1T2.txt"
)

Arguments

preparedData

Object returned by prepareMethylationGLMM_T1T2Data().

nCores

Integer. Number of worker processes to use.

libPath

Character vector or NULL. Optional library paths forwarded to worker processes.

lmeLibs

Character vector or comma-separated string of package names to check on worker processes. The default is "lme4,lmerTest".

verbose

Logical. If TRUE, emit progress messages with message().

logs

Logical. If TRUE, write the same messages to a log file.

log_dir

Character or NULL. Directory used for the log file when logs = TRUE.

log_file

Character. File name used when logs = TRUE.

Value

A list with class "dnaEPICO_methylationGLMM_T1T2_models" containing fitted model lists, model formulas, and counts of failed CpG fits.

Examples

ex <- dnaEPICO:::exampleMethylationGLMMStateDnaEpico()
model_results <- fitMethylationGLMM_T1T2Models(
  preparedData = ex$preparedData,
  nCores = 1,
  verbose = FALSE,
  logs = FALSE
)
names(model_results$fits)
#> [1] "score"