Align phenotype rows and metric matrices for each requested timepoint, and precompute the per-timepoint phenotype-plus-beta objects used by downstream modeling functions.

splitTimepointsPreprocessingPheno(
  pheno,
  metricsData,
  SampleID = "Sample_Name",
  timeVar = "Timepoint",
  timepoints = "1,2",
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_splitTimepointsPreprocessingPheno.txt"
)

Arguments

pheno

Data frame containing phenotype information.

metricsData

Object returned by loadMetricsPreprocessingPheno().

SampleID

Character. Name of the sample identifier column in pheno.

timeVar

Character. Name of the timepoint column in pheno.

timepoints

Character vector or comma-separated string of timepoints to retain.

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_timepoints" containing the parsed timepoints and aligned per-timepoint subsets.

Examples

ex <- dnaEPICO:::examplePreprocessingPhenoStateDnaEpico()
timepoint_data <- splitTimepointsPreprocessingPheno(
  pheno = ex$pheno,
  metricsData = ex$metricsData,
  SampleID = "Sample_Name",
  timeVar = "Timepoint",
  timepoints = "1,2",
  verbose = FALSE,
  logs = FALSE
)
timepoint_data$timepoints
#> [1] "1" "2"