R/methylationGLM_steps.R
writeMethylationGLMOutputs.RdWrite compact phenotype summaries, optional text and significant-CpG tables, and annotated results from the one-timepoint GLM workflow.
writeMethylationGLMOutputs(
modelResults,
modelSummaries,
annotatedResults,
significantCpGs = NULL,
outputRData,
summaryTxtDir,
significantCpGDir,
annotatedGLMOut,
reportAssetsDir = NULL,
vennDResults = NULL,
saveTxtSummaries = TRUE,
saveSignificantCpGs = FALSE,
verbose = FALSE,
logs = FALSE,
log_dir = NULL,
log_file = "log_methylationGLM.txt"
)Object returned by fitMethylationGLMModels().
Object returned by summarizeMethylationGLMModels().
Object returned by
annotateMethylationGLMSummaries() or a compatible data frame.
Object returned by
collectSignificantCpGsMethylationGLM() or NULL.
Character. Directory used for complete compact phenotype summaries.
Character. Directory used for tab-delimited summary tables.
Character. Directory used for significant-CpG coefficient tables.
Character. Directory used for the annotated summary XLSX workbook.
Character or NULL. Report results directory used for
the compressed TSV table and compact metadata sidecars.
Optional model-level Venn result. Its configuration metadata and threshold tables are added before the workbook dictionary.
Logical. If TRUE, write tab-delimited summary
tables.
Logical. If TRUE, write significant-CpG
coefficient tables.
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_paths' containing
the paths of the files written to disk, including the annotated workbook
and any requested report-table sidecars.
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)
#> [1] "modelFiles" "summaryFiles"
#> [3] "summaryTxtFiles" "significantCpGFiles"
#> [5] "annotatedGLM" "annotatedGLMText"
#> [7] "annotatedGLMReportMetadata" "annotatedGLMDictionary"
#> [9] "annotatedGLMMetadata" "vennDSheets"