R/methylationGLM_steps.R
fitMethylationGLMModels.RdFit one Gaussian GLM per CpG for each phenotype requested in the object
returned by prepareMethylationGLMData(). Each native fit is reduced to
compact numerical results and discarded before the next batch is returned.
fitMethylationGLMModels(
preparedData,
nCores = 1L,
libPath = NULL,
glmLibs = "glm2",
summaryDir = NULL,
omnibusTest = FALSE,
resumeFromSummary = TRUE,
verbose = FALSE,
logs = FALSE,
log_dir = NULL,
log_file = "log_methylationGLM.txt"
)Object returned by prepareMethylationGLMData().
Integer. Maximum number of worker processes to use. Automatic fitting remains serial below the glm2 crossover and caps workers by available CpGs, CPUs, and detected memory.
Character vector or NULL. Optional library paths forwarded
to worker processes.
Character vector or comma-separated string of package names to
check on worker processes. The default is 'glm2'.
Character or NULL. Directory used for one complete
compact summary per phenotype. NULL disables disk persistence.
Logical. If TRUE, use car::linearHypothesis() to test
the complete phenotype-by-interaction term, or the phenotype main effect
when no interaction is specified, once per CpG.
Logical. If TRUE, reuse a complete summary in
summaryDir when it was generated from the same input file and model
configuration.
Logical. If TRUE, emit progress messages with message().
Logical. If TRUE, write the same messages to a log file.
Character or NULL. Directory used for the log file when
logs = TRUE.
Character. File name used when logs = TRUE.
A list with class 'dnaEPICO_methylationGLM_models' containing
compact coefficient matrices, unfiltered target summaries, formulas,
model conditions, hard errors, and phenotype summary artifacts.
ex <- dnaEPICO:::exampleMethylationGLMStateDnaEpico()
model_results <- fitMethylationGLMModels(
preparedData = ex$preparedData,
nCores = 1,
verbose = FALSE,
logs = FALSE
)
names(model_results$fits)
#> [1] "status"