R/methylationGLMM_T1T2_steps.R
prepareMethylationGLMM_T1T2Data.RdLoad the merged longitudinal phenotype-plus-beta object, ensure that a subject identifier column is available, validate the requested modeling variables, convert selected variables to factors, and return a single in-memory object for downstream mixed-effects modeling helpers.
prepareMethylationGLMM_T1T2Data(
inputPheno,
personVar = "person",
timeVar = "Timepoint",
phenotypes,
covariates,
factorVars,
prsMap = NULL,
cpgPrefix = "cg",
cpgLimit = NA,
interactionTerm = NULL,
verbose = FALSE,
logs = FALSE,
log_dir = NULL,
log_file = "log_methylationGLMM_T1T2.txt"
)Character. Path to the merged longitudinal phenotype-plus-
beta object created by preprocessingPheno().
Character. Name of the subject identifier column.
Character. Name of the time variable.
Character vector or comma-separated string of phenotype variables to model.
Character vector or comma-separated string of covariate variables to adjust for.
Character vector or comma-separated string of variables that should be converted to factors before modeling.
Character vector or comma-separated string of phenotype-to-PRS
mappings in the form "Phenotype:PRS".
Character. Prefix used to identify methylation columns.
Integer or NA. Maximum number of CpGs to retain. NA
keeps all matching CpGs.
Character or NULL. Optional interaction term.
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_methylationGLMM_T1T2_data" containing
the prepared analysis data, parsed variable selections, CpG columns,
timepoint summaries, and subject-ID diagnostics.
ex <- dnaEPICO:::exampleMethylationGLMMStateDnaEpico()
prepared_data <- prepareMethylationGLMM_T1T2Data(
inputPheno = ex$inputPath,
personVar = "person",
timeVar = "Timepoint",
phenotypes = "score",
covariates = "sex",
factorVars = "sex,Timepoint",
cpgLimit = 2,
verbose = FALSE,
logs = FALSE
)
names(prepared_data)
#> [1] "data" "personVar"
#> [3] "timeVar" "phenotypes"
#> [5] "covariates" "factorVars"
#> [7] "prsMap" "cpgColumns"
#> [9] "cpgPrefix" "cpgLimit"
#> [11] "interactionTerm" "requestedInteractionTerm"
#> [13] "personCreated" "personCounts"
#> [15] "personMappingPreview" "timepointSummary"