% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methylationLME_steps.R
\name{writeMethylationLMEOutputs}
\alias{writeMethylationLMEOutputs}
\title{Write optional disk outputs for longitudinal mixed-effects analyses}
\usage{
writeMethylationLMEOutputs(
  modelResults,
  modelSummaries,
  annotatedResults,
  significantInteractions = NULL,
  outputRData,
  summaryTxtDir,
  significantInteractionDir,
  annotatedLMEOut,
  reportAssetsDir = NULL,
  saveTxtSummaries = TRUE,
  saveSignificantInteractions = FALSE,
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_methylationLME.txt"
)
}
\arguments{
\item{modelResults}{Object returned by \code{fitMethylationLMEModels()}.}

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

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

\item{significantInteractions}{Object returned by
\code{collectSignificantInteractionsMethylationLME()} 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{significantInteractionDir}{Character. Directory used for significant
interaction coefficient tables.}

\item{annotatedLMEOut}{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{saveSignificantInteractions}{Logical. If \code{TRUE}, write significant
interaction 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_methylationLME_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 interaction
tables, and annotated results from the longitudinal mixed-effects workflow.
}
\examples{
ex <- dnaEPICO:::exampleMethylationLMEStateDnaEpico()
annotation_data <- annotateMethylationLMESummaries(
    modelSummaries = ex$modelSummaries,
    annotationObject = ex$annotationData,
    annotationCols = "Name,chr,pos",
    verbose = FALSE,
    logs = FALSE
)
significant_hits <- collectSignificantInteractionsMethylationLME(
    modelResults = ex$modelResults,
    pvalThreshold = 1,
    verbose = FALSE,
    logs = FALSE
)
output_paths <- writeMethylationLMEOutputs(
    modelResults = ex$modelResults,
    modelSummaries = ex$modelSummaries,
    annotatedResults = annotation_data,
    significantInteractions = significant_hits,
    outputRData = file.path(ex$tempDir, "models"),
    summaryTxtDir = file.path(ex$tempDir, "summary"),
    significantInteractionDir = file.path(ex$tempDir, "significant"),
    annotatedLMEOut = file.path(ex$tempDir, "annotated"),
    saveTxtSummaries = TRUE,
    saveSignificantInteractions = TRUE,
    verbose = FALSE,
    logs = FALSE
)
names(output_paths)

}
