R/estimateLCMinfiEwasWater.R
estimateLCMinfiEwasWater.RdEstimate cell proportions from beta values using estimateLC() for saliva
reference panels or ENmix::estimateCellProp() for other supported
references, then merge the estimates into the phenotype table.
estimateLCMinfiEwasWater(
beta,
targets,
lcRef = "salivaEPIC",
phenoOrder = "Sample_Name;Timepoint;Sex;PredSex;Basename;Sentrix_ID;Sentrix_Position",
constrained = FALSE,
verbose = FALSE,
logs = FALSE,
log_dir = NULL,
log_file = "log_estimateLCMinfiEwasWater.txt"
)Numeric matrix of beta values with probes in rows and samples in columns.
Phenotype data frame aligned with the columns of beta.
Character. Cell-composition reference. Internal saliva-based
references supported through estimateLC() are "saliva" and
"salivaEPIC". Other references are passed to
ENmix::estimateCellProp().
Character vector or semicolon-separated string describing
the phenotype columns that should appear first in the merged phenoLC
output.
Logical. Passed to estimateLC() when an internal saliva
reference is used. If TRUE, estimated proportions are constrained to sum
to one.
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_minfiEwasWater_lc" containing the cell
proportion matrix, merged phenotype table, reference name, and method used.
ref_file <- system.file("extdata", "saliva.txt", package = "dnaEPICO")
beta <- as.matrix(utils::read.table(ref_file))[1:20, , drop = FALSE]
colnames(beta) <- c("sample1", "sample2")
targets <- data.frame(
Sample_Name = colnames(beta),
Timepoint = c("T1", "T2"),
stringsAsFactors = FALSE
)
lc_data <- estimateLCMinfiEwasWater(
beta = beta,
targets = targets,
lcRef = "saliva",
phenoOrder = "Sample_Name;Timepoint"
)
stopifnot(is.data.frame(lc_data$phenoLC))