% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methylationGLM_steps.R
\name{writeMethylationGLMOutputs}
\alias{writeMethylationGLMOutputs}
\title{Write optional disk outputs for one-timepoint GLM analyses}
\usage{
writeMethylationGLMOutputs(
  modelResults,
  modelSummaries,
  annotatedResults,
  significantCpGs = NULL,
  outputRData,
  summaryTxtDir,
  significantCpGDir,
  annotatedGLMOut,
  reportAssetsDir = NULL,
  saveTxtSummaries = TRUE,
  saveSignificantCpGs = FALSE,
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_methylationGLM.txt"
)
}
\arguments{
\item{modelResults}{Object returned by \code{fitMethylationGLMModels()}.}

\item{modelSummaries}{Object returned by \code{summarizeMethylationGLMModels()}.}

\item{annotatedResults}{Object returned by
\code{annotateMethylationGLMSummaries()} or a compatible data frame.}

\item{significantCpGs}{Object returned by
\code{collectSignificantCpGsMethylationGLM()} or \code{NULL}.}

\item{outputRData}{Character. Directory used for serialized model and summary
outputs.}

\item{summaryTxtDir}{Character. Directory used for tab-delimited summary
tables.}

\item{significantCpGDir}{Character. Directory used for significant-CpG
coefficient tables.}

\item{annotatedGLMOut}{Character. Directory used for the annotated summary
XLSX workbook.}

\item{reportAssetsDir}{Character or \code{NULL}. Report results directory used for
the compressed TSV table and compact metadata sidecars.}

\item{saveTxtSummaries}{Logical. If \code{TRUE}, write tab-delimited summary
tables.}

\item{saveSignificantCpGs}{Logical. If \code{TRUE}, write significant-CpG
coefficient tables.}

\item{verbose}{Logical. If \code{TRUE}, emit progress messages with \code{message()}.}

\item{logs}{Logical. If \code{TRUE}, write the same messages to a log file.}

\item{log_dir}{Character or \code{NULL}. Directory used for the log file when
\code{logs = TRUE}.}

\item{log_file}{Character. File name used when \code{logs = TRUE}.}
}
\value{
A list with class \code{'dnaEPICO_methylationGLM_paths'} containing
the paths of the files written to disk, including the annotated workbook
and any requested report-table sidecars.
}
\description{
Write optional serialized outputs, summary tables, significant-CpG tables,
and annotated results from the one-timepoint GLM workflow.
}
\examples{
ex <- dnaEPICO:::exampleMethylationGLMStateDnaEpico()
annotation_data <- annotateMethylationGLMSummaries(
    modelSummaries = ex$modelSummaries,
    annotationObject = ex$annotationData,
    annotationCols = "Name,chr,pos",
    verbose = FALSE,
    logs = FALSE
)
significant_cpgs <- collectSignificantCpGsMethylationGLM(
    modelResults = ex$modelResults,
    pvalThreshold = 1,
    verbose = FALSE,
    logs = FALSE
)
output_paths <- writeMethylationGLMOutputs(
    modelResults = ex$modelResults,
    modelSummaries = ex$modelSummaries,
    annotatedResults = annotation_data,
    significantCpGs = significant_cpgs,
    outputRData = file.path(ex$tempDir, "models"),
    summaryTxtDir = file.path(ex$tempDir, "summary"),
    significantCpGDir = file.path(ex$tempDir, "significant"),
    annotatedGLMOut = file.path(ex$tempDir, "annotated"),
    saveTxtSummaries = TRUE,
    saveSignificantCpGs = TRUE,
    verbose = FALSE,
    logs = FALSE
)
names(output_paths)

}
