% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/qSVA.R
\name{qSVA}
\alias{qSVA}
\title{A wrapper function used to perform qSVA in one step.}
\usage{
qSVA(
  rse_tx,
  type = "cell_component",
  sig_transcripts = select_transcripts(type),
  mod,
  assayname
)
}
\arguments{
\item{rse_tx}{A \link[SummarizedExperiment:RangedSummarizedExperiment-class]{RangedSummarizedExperiment-class} object containing
the transcript data desired to be studied.}

\item{type}{a character string specifying which model you would
like to use when selecting a degradation matrix.}

\item{sig_transcripts}{A list of transcripts that are associated with
degradation signal. Use \code{select_transcripts()} to select sets of transcripts
identified by the qSVA expanded paper. Specifying a \code{character()} input of
ENSEMBL transcript IDs (or whatever values you have at \code{rownames(rse_tx)})
obtained outside of \code{select_transcripts()} overrides
the user friendly \code{type} argument. That is, this argument provides more fine
tuning options for advanced users.}

\item{mod}{Model Matrix with necessary variables the you would
model for in differential expression}

\item{assayname}{character string specifying the name of
the assay desired in rse_tx}
}
\value{
matrix with k principal components for each sample
}
\description{
A wrapper function used to perform qSVA in one step.
}
\examples{
## First we need to define a statistical model. We'll use the example
## covComb_tx_deg data. Note that the model you'll use in your own data
## might look different from this model.
mod <- model.matrix(~ mitoRate + Region + rRNA_rate + totalAssignedGene + RIN,
    data = colData(covComb_tx_deg)
)

## To ensure that the results are reproducible, you will need to set a
## random seed with the set.seed() function. Internally, we are using
## sva::num.sv() which needs a random seed to ensure reproducibility of the
## results.
set.seed(20230621)
qSVA(rse_tx = covComb_tx_deg, type = "cell_component", mod = mod, assayname = "tpm")

}
