Fit one Gaussian GLM per CpG for each phenotype requested in the object returned by prepareMethylationGLM_T1Data().

fitMethylationGLM_T1Models(
  preparedData,
  nCores = 1L,
  libPath = NULL,
  glmLibs = "glm2",
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_methylationGLM_T1.txt"
)

Arguments

preparedData

Object returned by prepareMethylationGLM_T1Data().

nCores

Integer. Number of worker processes to use.

libPath

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

glmLibs

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

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_methylationGLM_T1_models" containing fitted model lists, model formulas, and counts of failed CpG fits.

Examples

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