Write the merged phenotype plus cell-composition table

writePhenoLCMinfiEwasWater(
  lcData,
  file,
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_writePhenoLCMinfiEwasWater.txt"
)

Arguments

lcData

Object returned by estimateLCMinfiEwasWater().

file

Character. Path to the CSV file to write.

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

Invisibly returns file.

Examples

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"
)
output_file <- file.path(tempdir(), "phenoLC.csv")
writePhenoLCMinfiEwasWater(lcData = lc_data, file = output_file)
file.exists(output_file)
#> [1] TRUE