% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/batch_correction.R
\name{batch_correct}
\alias{batch_correct}
\title{Batch Correct
This function allows you to Add batch corrected count matrix to the SE object}
\usage{
batch_correct(se, method, assay_to_normalize, batch, group = NULL,
covar, output_assay_name, psva, num_sv, limit, numrepeats)
}
\arguments{
\item{se}{SummarizedExperiment object}

\item{method}{Normalization Method ("ComBat-Seq", "ComBat", "limma", "sva",
svaseq, "Harman")}

\item{assay_to_normalize}{Which assay use to do normalization}

\item{batch}{The batch}

\item{group}{The group variable}

\item{covar}{list of covariates}

\item{output_assay_name}{name of results assay}

\item{psva}{boolean; default: FALSE. Only used if normalization method is
"sva". If set to TRUE and no covariate input, psva function from the sva
package will be used to remove batch effect.}

\item{num_sv}{boolean; default: FALSE. Only used if normalization method is
"svaseq". The number of estimated latent factor is set to 1 for a small
number of samples. If set to TRUE, svaseq function will estimate the number
of latent factors for you.}

\item{limit}{numeric; default: 0.95. Only used if normalization method is
"Harman". Indicates the limit of confidence in which to stop removing a batch
effect. Must be between 0 and 1.}

\item{numrepeats}{integer; default: 100000L. Only used if normalization
method is "Harman". The number of repeats in which to run the simulated batch
mean distribution estimator using the random selection algorithm.}
}
\value{
a summarized experiment object with normalized assay appended
}
\description{
Batch Correct
This function allows you to Add batch corrected count matrix to the SE object
}
\examples{
library(scran)
se <- mockSCE()
se <- BatchQC::batch_correct(se, method = "ComBat-Seq",
                                    assay_to_normalize = "counts",
                                    batch = "Mutation_Status",
                                    covar = "Treatment",
                                    output_assay_name =
                                        "ComBat_Seq_Corrected")
se <- BatchQC::batch_correct(se, method = "ComBat",
                                    assay_to_normalize = "counts",
                                    batch = "Mutation_Status",
                                    covar = "Treatment",
                                    output_assay_name =
                                        "ComBat_Corrected")
se

}
