% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/svaEnmix_steps.R
\name{estimateSvaEnmixControls}
\alias{estimateSvaEnmixControls}
\title{Estimate surrogate variables from ENmix control probes}
\usage{
estimateSvaEnmixControls(
  RGSet,
  ctrlSvaPercVar = 0.9,
  ctrlSvaFlag = 1,
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_estimateSvaEnmixControls.txt"
)
}
\arguments{
\item{RGSet}{An \code{RGChannelSet}.}

\item{ctrlSvaPercVar}{Numeric. Proportion of variance explained by control
probes, passed to \code{ENmix::ctrlsva()}.}

\item{ctrlSvaFlag}{Integer. Control-probe flag passed to
\code{ENmix::ctrlsva()}.}

\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_sva'} containing the surrogate
variable matrix and the parameters used to estimate it.
}
\description{
Run \code{ENmix::ctrlsva()} on an \code{RGChannelSet} and return the surrogate variable
matrix as an in-memory object.
}
\examples{
\dontshow{if (requireNamespace("minfiData", quietly = TRUE)) withAutoprint(\{ # examplesIf}
ex <- dnaEPICO:::exampleMinfiBaseDataDnaEpico()
sva_data <- estimateSvaEnmixControls(
    RGSet = ex$RGSet,
    ctrlSvaPercVar = 0.5,
    ctrlSvaFlag = 1,
    verbose = FALSE,
    logs = FALSE
)
sva_data$K
\dontshow{\}) # examplesIf}
}
