\HeaderA{detectionCall}{Estimate the detectable probe ratio}{detectionCall}
\keyword{methods}{detectionCall}
\begin{Description}\relax
Estimate the detectable probe ratio of each probe, sample or just return an AP matrix
\end{Description}
\begin{Usage}
\begin{verbatim}
detectionCall(x.lumi, Th = 0.01, type = c('probe', 'sample', 'matrix'))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x.lumi}] a LumiBatch object 
\item[\code{Th}] the threshold. By default, when the detection p-value is less than 0.01, we suppose it is detectable. For the old version of BeadStudio output (version 2 or earlier), the threshold will automatically transferred as 1 - Th, because in the old format, value close to 1 is suppose to be detectable. 
\item[\code{type}] determine to calculate the detection count by probe or by sample 
\end{ldescription}
\end{Arguments}
\begin{Value}
If the type is 'probe', then returns the presentCount of each probe. If the type is 'sample', then return the detectable probe ratio of each sample. If the type is 'matrix', then return the AP matrix, in which 'A' represents absent (the detect p-value less than threshold) and 'P' represents present.
\end{Value}
\begin{Author}\relax
Pan Du
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{lumiQ}{lumiQ}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## load example data
data(example.lumi)
## load example data
data(example.lumi)

## estimate the detect call (percentage of expressed genes) of each sample
temp <- detectionCall(example.lumi, type='sample')
print(temp)

## estimate the present count of each gene (probe)
temp <- detectionCall(example.lumi, type='probe')
hist(temp)

\end{ExampleCode}
\end{Examples}

