% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGenerics.R, R/deSet-methods.R
\docType{methods}
\name{apply_snm}
\alias{apply_snm}
\alias{apply_snm,deSet-method}
\title{Supervised normalization of data in edge}
\usage{
apply_snm(object, int.var = NULL, ...)

\S4method{apply_snm}{deSet}(object, int.var = NULL, ...)
}
\arguments{
\item{object}{\code{S4 object}: \code{\linkS4class{deSet}}}

\item{int.var}{\code{data frame}: intensity-dependent effects (see 
\code{\link{snm}} for details)}

\item{...}{Additional arguments for \code{\link{snm}}}
}
\value{
\code{apply_snm} returns a \code{\linkS4class{deSet}} object where 
assayData (the expression data) that has been passed to apply_snm is replaced
with the normalized data that \code{\link{snm}} returns.  Specifically, 
\code{exprs(object)} is replaced by \code{$norm.dat} from \code{\link{snm}},
where \code{object} is the \code{\link{deSet}} object.
}
\description{
Runs \code{snm} on a deSet object based on the null and full models in
\code{\linkS4class{deSet}}. See \code{\link{snm}} for additional details
on the algorithm.
}
\examples{
# simulate data
library(snm)
singleChannel <- sim.singleChannel(12345)
data <- singleChannel$raw.data

# create deSet object using build_models (can use ExpressionSet see manual)
cov <- data.frame(grp = singleChannel$bio.var[,2])
full_model <- ~grp
null_model <- ~1

# create deSet object using build_models
de_obj <- build_models(data = data, cov = cov, full.model = full_model,
null.model = null_model)

# run snm using intensity-dependent adjustment variable
de_snm <- apply_snm(de_obj, int.var = singleChannel$int.var,
verbose = FALSE, num.iter = 1)

}
\author{
John Storey, Andrew Bass
}
\references{
Mechan BH, Nelson PS, Storey JD. Supervised normalization of microarrays.
Bioinformatics 2010;26:1308-1315.
}
\seealso{
\code{\linkS4class{deSet}}, \code{\link{odp}} and
\code{\link{lrt}}
}