% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGenerics.R, R/normalizeGC.R
\docType{methods}
\name{normalizeGC-methods}
\alias{normalizeGC-methods}
\alias{normalizeGC,SummarizedExomePeak-method}
\alias{normalizeGC}
\title{Method normalizeGC}
\usage{
normalizeGC(
  sep,
  bsgenome = "hg19",
  txdb = "hg19",
  gff_dir = NULL,
  fragment_length = 100,
  binding_length = 25,
  feature = c("Background", "Modification", "All"),
  qtnorm = FALSE,
  effective_GC = FALSE
)

\S4method{normalizeGC}{SummarizedExomePeak}(
  sep,
  bsgenome = NULL,
  txdb = NULL,
  gff_dir = NULL,
  fragment_length = 100,
  binding_length = 25,
  feature = c("Background", "Modification", "All"),
  qtnorm = FALSE,
  effective_GC = FALSE
)
}
\arguments{
\item{sep}{a \code{\link{SummarizedExomePeak}} object returned by \code{\link{exomePeak2}} or \code{\link{exomePeakCalling}}.}

\item{bsgenome}{a \code{\link{BSgenome}} object for the genome reference,
If the \code{BSgenome} object is not available, it could be a \code{character} string of the UCSC genome name which is acceptable by \code{\link{getBSgenome}}, example: \code{"hg19"}.}

\item{txdb}{a \code{\link{TxDb}} object for the transcript annotation,
If the \code{TxDb} object is not available, it could be a \code{character} string of the UCSC genome name which is acceptable by \code{\link{makeTxDbFromUCSC}}, example: \code{"hg19"}.}

\item{gff_dir}{optional, a \code{character} which specifies the directory toward a gene annotation GFF/GTF file, it is applied when the \code{TxDb} object is not available, default \code{= NULL}.}

\item{fragment_length}{a positive integer number for the expected fragment length in nucleotides; default \code{= 100}.}

\item{binding_length}{a positive integer number for the expected binding length of the anti-modification antibody in IP samples; default \code{= 25}.}

\item{feature}{a \code{character} specifies the region used in the GC content linear effect estimation, can be one in \code{c("Background","All","Modification")}; default is \code{"Background"}.

\describe{

 \item{\strong{\code{Background}}}{
 The GC content linear effects will be estimated on the background regions.
 By default, the background is defined as the exon regions not overlapping with peaks / modification sites flanked by the fragment length.
 You could select alternative background finding methods with \code{background} at \code{\link{exomePeakCalling}}.
 }

 \item{\strong{\code{Modification}}}{
 The GC content linear effects will be estimated on the regions of modification peaks/sites.
 }

 \item{\strong{\code{All}}}{
 The GC content linear effects will be estimated on all regions, i.e. both the region of modification and the background control regions.
 }


}}

\item{qtnorm}{a \code{logical} of whether to perform subset quantile normalization after the GC content linear effect correction; default \code{= FALSE}.

If \code{qtnorm = TRUE}, subset quantile normalization will be applied within the IP and input samples seperately to account for the inherent differences between the marginal distributions of IP and input samples.}

\item{effective_GC}{a \code{logical} of whether to calculate the effective GC content weighted by the fragment alignment probabilities; default \code{= FALSE}.}
}
\value{
a \code{SummarizedExomePeak} object with the updated slot \code{GCsizeFactors}.
}
\description{
\code{normalizeGC} estimates the feature specific size factors in order to reduce the technical variation during modification peak statistics quantification.
}
\details{
PCR amplication bias related to GC content is a major source of technical variation in RNA-seq.
The GC content biases are usually correlated within the same laboratory environment, and this will result in the batch effect between different studies.

The GC content normalization can result in an improvement of peak accuracy for most published m6A-seq data,
and it is particullarly recommended if you want to compare the quantifications on methylation levels between different laboratory conditions.
}
\examples{

### Load the example SummarizedExomPeak object
f1 = system.file("extdata", "sep_ex_mod.rds", package="exomePeak2")

sep <- readRDS(f1)

### Normalize the GC content biases
sep <- normalizeGC(sep)

}
\seealso{
\code{\link{estimateSeqDepth}}
}
