Return phenotype-specific CpG coefficient tables from the compact fit-time results produced by fitMethylationGLMModels().

summarizeMethylationGLMModels(
  modelResults,
  preparedData,
  summaryResidualSD = TRUE,
  summaryPval = NA,
  padjmethod = "fdr",
  nCores = 1L,
  libPath = NULL,
  glmLibs = "glm2",
  chunkSize = NULL,
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_methylationGLM.txt"
)

Arguments

modelResults

Object returned by fitMethylationGLMModels().

preparedData

Object returned by prepareMethylationGLMData().

summaryResidualSD

Logical. If TRUE, add residual standard deviations to each CpG summary row.

summaryPval

Numeric or NA. Optional p-value filter applied to the returned summary tables. NA keeps all rows.

padjmethod

Character. Adjustment method passed to stats::p.adjust() for omnibus p-values across CpGs within each phenotype and tested term.

nCores

Integer. Number of worker processes to use while extracting summary rows.

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'.

chunkSize

Integer or NULL. Number of CpGs to process per parallel chunk. NULL chooses a value automatically.

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_summaries' containing the optionally filtered summary tables in summaries and the complete CpG-level tables in diagnosticSummaries. Diagnostics, annotation, and report output use the complete tables so summaryPval does not remove CpGs from those outputs. modelMessages retains native messages, warnings, and errors for every attempted CpG.

Examples

ex <- dnaEPICO:::exampleMethylationGLMStateDnaEpico()
summary_results <- summarizeMethylationGLMModels(
  modelResults = ex$modelResults,
  preparedData = ex$preparedData,
  summaryResidualSD = TRUE,
  summaryPval = NA,
  nCores = 1,
  verbose = FALSE,
  logs = FALSE
)
names(summary_results$summaries)
#> [1] "status"