Write the legacy CSV, ZIP, and .RData outputs produced by preprocessingPheno(). This helper keeps file writing separate from the in-memory preprocessing steps.

writePreprocessingPhenoOutputs(
  preprocessingData,
  outputPheno = "data/preprocessingPheno",
  outputRData = "rData/preprocessingPheno/metrics",
  outputRDataMerge = "rData/preprocessingPheno/mergeData",
  outputDir = "data/preprocessingPheno",
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_writePreprocessingPhenoOutputs.txt"
)

Arguments

preprocessingData

Object returned by preprocessingPheno() or a list with the same components.

outputPheno

Character. Directory used for saved phenotype CSV files.

outputRData

Character. Directory used for saved metric .RData files.

outputRDataMerge

Character. Directory used for saved merged phenotype-plus-beta .RData files.

outputDir

Character. Directory used for the Clock Foundation export files.

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_preprocessingPheno_paths" containing the paths written to disk.

Examples

ex <- dnaEPICO:::examplePreprocessingPhenoStateDnaEpico()
output_paths <- writePreprocessingPhenoOutputs(
  preprocessingData = ex$preprocessingData,
  outputPheno = file.path(ex$tempDir, "pheno"),
  outputRData = file.path(ex$tempDir, "metrics"),
  outputRDataMerge = file.path(ex$tempDir, "merge"),
  outputDir = file.path(ex$tempDir, "clock"),
  verbose = FALSE,
  logs = FALSE
)
names(output_paths)
#> [1] "timepoints"        "combinedPheno"     "combinedPhenoBeta"
#> [4] "betaCSV"           "betaZIP"           "phenoCF"