% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGenerics.R, R/glmM.R
\name{glmM-methods}
\alias{glmM-methods}
\alias{glmM,SummarizedExomePeak-method}
\alias{glmM}
\title{Method glmM}
\usage{
glmM(
  sep,
  glm_type = c("DESeq2", "NB", "Poisson"),
  LFC_shrinkage = c("apeglm", "Gaussian", "ashr"),
  ...
)

\S4method{glmM}{SummarizedExomePeak}(
  sep,
  glm_type = c("DESeq2", "NB", "Poisson"),
  LFC_shrinkage = c("apeglm", "Gaussian", "ashr"),
  ...
)
}
\arguments{
\item{sep}{a \code{summarizedExomePeak} object.}

\item{glm_type}{a \code{character} speciefies the type of Generalized Linear Model (GLM) fitted for the purpose of statistical inference during peak calling, which can be one of the \code{c("DESeq2", "NB", "Poisson")}.

\describe{
\item{\strong{\code{DESeq2}}}{Fit the GLM defined in the function \code{\link{DESeq}}, which is the NB GLM with regulated estimation of the overdispersion parameters.}

\item{\strong{\code{NB}}}{Fit the Negative Binomial (NB) GLM.}

\item{\strong{\code{Poisson}}}{Fit the Poisson GLM.}
}

By default, the DESeq2 GLMs are fitted on the data set with > 1 biological replicates for both the IP and input samples, the Poisson GLM will be fitted otherwise.}

\item{LFC_shrinkage}{a \code{character} for the method of emperical bayes shrinkage on log2FC, could be one of \code{c("apeglm", "Gaussian", "ashr", "none")}; Default \code{= "apeglm"}.

see \code{\link{lfcShrink}} for details; if "none" is selected, only the MLE will be returned.}

\item{...}{Optional arguments passed to \code{\link{DESeq}}}
}
\value{
a \code{SummarizedExomPeak} object.
}
\description{
\code{glmM} performs inference and estimation on IP/input log2FC.

GLMs with the design of an indicator of IP samples are fitted for each peaks/sites:

\deqn{log2(Q) = intercept + I(IP)}

The log2FC and the associated statistics are based on the coefficient estimate of the dummy variable term: \eqn{I(IP)}.

Under default setting, the returned log2FC are the RR estimates with Couchey priors defined in \code{\link{apeglm}}.
}
\examples{

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

sep <- readRDS(f1)

### Select only the control group to avoid warning.
sep <- sep[,!colData(sep)$design_Treatment]

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

### Calculate GLM Statistics on the Modification Peaks
sep <- glmM(sep)

}
\seealso{
\code{\link{glmDM}}
}
