% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/svaEnmix_steps.R
\name{writeSvaEnmixOutputs}
\alias{writeSvaEnmixOutputs}
\title{Write svaEnmix outputs to disk}
\usage{
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{
\item{svaData}{Object returned by \code{estimateSvaEnmixControls()}.}

\item{mergedPheno}{Phenotype data frame returned by \code{mergeSvaTargetsEnmix()}.}

\item{analysisData}{Optional object returned by \code{analyzeSvaEnmix()}.}

\item{phenoFile}{Character or \code{NULL}. Existing phenotype file replaced with
\code{mergedPheno} after validation.}

\item{SampleID}{Character. Phenotype column containing sample identifiers.}

\item{sepType}{Character or \code{NULL}. Field separator used by \code{phenoFile}.}

\item{dataBaseDir}{Character. Base directory used for saved data outputs.}

\item{rBaseDir}{Character. Base directory used for saved \code{.RData} outputs.}

\item{scriptLabel}{Character. Label used to create the output subdirectory.}

\item{verbose}{Logical. If \code{TRUE}, emit progress messages with \code{message()}.}

\item{logs}{Logical. If \code{TRUE}, write the same messages to a log file.}

\item{log_dir}{Character or \code{NULL}. Directory used for the log file when
\code{logs = TRUE}.}

\item{log_file}{Character. File name used when \code{logs = TRUE}.}
}
\value{
A list with class \code{'dnaEPICO_svaEnmix_paths'} containing the paths
written to disk.
}
\description{
Write the SVA matrix, phenotype, and model-summary outputs.
}
\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)

}
