R/methylationGLM_T1_steps.R
prepareMethylationGLM_T1Data.RdLoad the merged phenotype-plus-beta input object, validate the requested modeling variables, convert selected variables to factors, and return a single in-memory object for downstream helpers.
prepareMethylationGLM_T1Data(
inputPheno,
phenotypes,
covariates,
factorVars,
cpgPrefix = "cg",
cpgLimit = NA,
interactionTerm = NULL,
prsMap = NULL,
verbose = FALSE,
logs = FALSE,
log_dir = NULL,
log_file = "log_methylationGLM_T1.txt"
)Character. Path to the merged phenotype-plus-beta object
created by preprocessingPheno().
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. 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.
Character vector or comma-separated string of phenotype-to-PRS
mappings in the form "Phenotype:PRS".
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_T1_data" containing the
prepared analysis data, parsed variable selections, CpG columns, and
exploratory summaries.
ex <- dnaEPICO:::exampleMethylationGLMStateDnaEpico()
prepared_data <- prepareMethylationGLM_T1Data(
inputPheno = ex$inputPath,
phenotypes = "status",
covariates = "sex,age",
factorVars = "status,sex",
cpgLimit = 2,
verbose = FALSE,
logs = FALSE
)
names(prepared_data)
#> [1] "data" "phenotypes"
#> [3] "covariates" "factorVars"
#> [5] "cpgColumns" "cpgPrefix"
#> [7] "cpgLimit" "prsMap"
#> [9] "interactionTerm" "requestedInteractionTerm"
#> [11] "missingCounts" "variableSummary"
#> [13] "interactionTable"