\HeaderA{generateExprVal.method.pdnn}{Compute PM correction and summary expression value}{generateExprVal.method.pdnn}
\aliasA{pmcorrect.pdnn}{generateExprVal.method.pdnn}{pmcorrect.pdnn}
\aliasA{pmcorrect.pdnnpredict}{generateExprVal.method.pdnn}{pmcorrect.pdnnpredict}
\keyword{manip}{generateExprVal.method.pdnn}
\begin{Description}\relax
Computes PM correction and summary expression value with PDNN method.
\end{Description}
\begin{Usage}
\begin{verbatim}
pmcorrect.pdnn(object, params, gene=NULL, gene.i=NULL,
               params.chiptype=NULL, outlierlim=3, callingFromExpresso=FALSE)
pmcorrect.pdnnpredict(object, params, gene=NULL, gene.i=NULL,
               params.chiptype=NULL, outlierlim=3, callingFromExpresso=FALSE)
generateExprVal.method.pdnn(probes, params)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] object of \code{\LinkA{ProbeSet}{ProbeSet}}.
\item[\code{probes}] matrix of PM-corrected signals (should be coming out of
\code{pmcorrect.pdnn}).
\item[\code{params}] experiments specific parameters.
\item[\code{gene}] gene (probe set) ID (from wich the \code{gene.i} would be
derived).
\item[\code{gene.i}] gene index (see details).
\item[\code{params.chiptype}] chip-specific parameters.
\item[\code{outlierlim}] threshold for tagging a probe as an outlier.
\item[\code{callingFromExpresso}] is the function called through
expresso. DO NOT play with that.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Only one of \code{gene}, \code{gene.i} should be specified. For most
the users, this is \code{gene}.
\code{\LinkA{pmcorrect.pdnn}{pmcorrect.pdnn}} and \code{\LinkA{pmcorrect.pdnnpredict}{pmcorrect.pdnnpredict}}
return what is called GSB and GSB + NSB + B in the paper by Zhang Li
and collaborators.
\end{Details}
\begin{Value}
\code{pmcorrect.pdnn} and \code{pmcorrect.pdnnpredict} return a matrix (one row per probe, one column
per chip) with attributes attached. \code{generateExprVal} returns a
\code{list}:
\begin{ldescription}
\item[\code{exprs}] expression values
\item[\code{se.exprs}] se expr. val.
\end{ldescription}
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{pdnn.params.chiptype}{pdnn.params.chiptype}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(hgu95av2.pdnn.params)
library(affydata)
data(Dilution)

## only one CEL to go faster
abatch <- Dilution[, 1]

## get the chip specific parameters
params <- find.params.pdnn(abatch, hgu95av2.pdnn.params)

## The thrill part: do we get like in the Figure 1-a of the reference ?
par(mfrow=c(2,2))
##ppset.name <- sample(featureNames(abatch), 2)
ppset.name <- c("41206_r_at", "31620_at")
ppset <- probeset(abatch, ppset.name)
for (i in 1:2) {
  ##ppset[[i]] <- transform(ppset[[i]], fun=log) # take the log as they do
  probes.pdnn <- pmcorrect.pdnnpredict(ppset[[i]], params,
                                       params.chiptype=hgu95av2.pdnn.params)
  ##probes.pdnn <- log(probes.pdnn)
  plot(ppset[[i]], main=paste(ppset.name[i], "\n(raw intensities)"))
  matplotProbesPDNN(probes.pdnn, main=paste(ppset.name[i], "\n(predicted intensities)"))
}

## pick the 50 first probeset IDs
## (to go faster)
ids <- featureNames(abatch)[1:100]

## compute the expression set (object of class 'ExpressionSet')
eset <- computeExprSet(abatch, pmcorrect.method="pdnn",
                       summary.method="pdnn", ids=ids,
                       summary.param = list(params, params.chiptype=hgu95av2.pdnn.params))

\end{ExampleCode}
\end{Examples}

