Write the SVA matrix, phenotype, and model-summary outputs.

writeSvaEnmixOutputs(
  svaData,
  mergedPheno,
  analysisData = NULL,
  phenoFile = NULL,
  SampleID = "Sample_Name",
  sepType = NULL,
  dataBaseDir = "data",
  rBaseDir = "rData",
  scriptLabel = "svaEnmix",
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_writeSvaEnmixOutputs.txt"
)

Arguments

svaData

Object returned by estimateSvaEnmixControls().

mergedPheno

Phenotype data frame returned by mergeSvaTargetsEnmix().

analysisData

Optional object returned by analyzeSvaEnmix().

phenoFile

Character or NULL. Existing phenotype file replaced with mergedPheno after validation.

SampleID

Character. Phenotype column containing sample identifiers.

sepType

Character or NULL. Field separator used by phenoFile.

dataBaseDir

Character. Base directory used for saved data outputs.

rBaseDir

Character. Base directory used for saved .RData outputs.

scriptLabel

Character. Label used to create the output subdirectory.

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

A list with class 'dnaEPICO_svaEnmix_paths' containing the paths written to disk.

Examples

ex <- dnaEPICO:::exampleSvaAnalysisStateDnaEpico()
temp_dir <- tempdir()
pheno_file <- file.path(temp_dir, "phenoLC.csv")
utils::write.csv(ex$targets, pheno_file, row.names = FALSE)
output_paths <- writeSvaEnmixOutputs(
  svaData = list(sva = ex$sva),
  mergedPheno = ex$mergedPheno,
  analysisData = ex$analysisData,
  phenoFile = pheno_file,
  SampleID = "Sample_Name",
  dataBaseDir = file.path(temp_dir, "data"),
  rBaseDir = file.path(temp_dir, "rData"),
  scriptLabel = "svaEnmixExample",
  verbose = FALSE,
  logs = FALSE
)
names(output_paths)
#> [1] "svaRData"     "svaCSV"       "phenoWithSva" "dataDir"      "rDir"