Write compact phenotype summaries, optional text and significant-interaction tables, and annotated results from the longitudinal mixed-effects workflow.

writeMethylationLMEOutputs(
  modelResults,
  modelSummaries,
  annotatedResults,
  significantInteractions = NULL,
  outputRData,
  summaryTxtDir,
  significantInteractionDir,
  annotatedLMEOut,
  reportAssetsDir = NULL,
  vennDResults = NULL,
  saveTxtSummaries = TRUE,
  saveSignificantInteractions = FALSE,
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_methylationLME.txt"
)

Arguments

modelResults

Object returned by fitMethylationLMEModels().

modelSummaries

Object returned by summarizeMethylationLMEModels().

annotatedResults

Object returned by annotateMethylationLMESummaries() or a compatible data frame.

significantInteractions

Object returned by collectSignificantInteractionsMethylationLME() or NULL.

outputRData

Character. Directory used for complete compact phenotype summaries.

summaryTxtDir

Character. Directory used for tab-delimited summary tables.

significantInteractionDir

Character. Directory used for significant interaction coefficient tables.

annotatedLMEOut

Character. Directory used for the annotated summary XLSX workbook.

reportAssetsDir

Character or NULL. Report results directory used for the compressed TSV table and compact metadata sidecars.

vennDResults

Optional model-level Venn result. Its configuration metadata and threshold tables are added before the workbook dictionary.

saveTxtSummaries

Logical. If TRUE, write tab-delimited summary tables.

saveSignificantInteractions

Logical. If TRUE, write significant interaction coefficient tables.

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_methylationLME_paths' containing the paths of the files written to disk, including the annotated workbook and any requested report-table sidecars.

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)
#>  [1] "modelFiles"                  "summaryFiles"               
#>  [3] "summaryTxtFiles"             "significantInteractionFiles"
#>  [5] "annotatedLME"                "annotatedLMEText"           
#>  [7] "annotatedLMEReportMetadata"  "annotatedLMEDictionary"     
#>  [9] "annotatedLMEMetadata"        "vennDSheets"