% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocessingPheno_steps.R
\name{splitTimepointsPreprocessingPheno}
\alias{splitTimepointsPreprocessingPheno}
\title{Split phenotype and methylation data by timepoint}
\usage{
splitTimepointsPreprocessingPheno(
  pheno,
  metricsData,
  SampleID = "Sample_Name",
  timeVar = "Timepoint",
  timepoints = "1,2",
  methylationScale = "beta",
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_splitTimepointsPreprocessingPheno.txt"
)
}
\arguments{
\item{pheno}{Data frame containing phenotype information.}

\item{metricsData}{Object returned by \code{loadMetricsPreprocessingPheno()}.}

\item{SampleID}{Character. Name of the sample identifier column in \code{pheno}.}

\item{timeVar}{Character. Name of the timepoint column in \code{pheno}.}

\item{timepoints}{Character vector or comma-separated string of timepoints to
retain.}

\item{methylationScale}{Character. Methylation metric to use for the merged
modeling table. One of \code{'Beta'}, \code{'M'}, or \code{'CN'}, case-insensitively.}

\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_preprocessingPheno_timepoints'}
containing the parsed timepoints and aligned per-timepoint subsets.
}
\description{
Align phenotype rows and metric matrices for each requested timepoint, and
precompute the per-timepoint phenotype-plus-beta objects used by downstream
modeling functions.
}
\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

}
