\HeaderA{detectOutlier}{Detect the outlier sample (or gene)}{detectOutlier}
\keyword{methods}{detectOutlier}
\begin{Description}\relax
Detect the outlier sample (or gene) based on distance to the cluster center
\end{Description}
\begin{Usage}
\begin{verbatim}
detectOutlier(x, metric = "euclidean", standardize = TRUE, Th = 2, ifPlot = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a LumiBatch object, ExpressionSet object or a matrix with each column corresponding to a sample or other profile 
\item[\code{metric}] the distance matric
\item[\code{standardize}] standardize the profile or not 
\item[\code{Th}] the threshold of outlier,  
\item[\code{ifPlot}] to plot the result (as a hierarchical tree) or not 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The current outlier detection is based on the distance from the sample to the center (average of all samples).
The assumption of the outlier detection is that there is only one single cluster and the distance from the sample
to the center is Gaussian distributed.

The outlier is detected when its distance to the center is larger than a certain threshold.
The threshold is calculated as Th * median distances to the center.

The profile relations can be visualized as a hierarchical tree.
\end{Details}
\begin{Value}
Plot the results or     return the outlier (a logic vector) with the distance matrix and threshold as attributes.
\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)

## detect the outlier (Further improvement needed.)
temp <- detectOutlier(example.lumi, ifPlot=TRUE)

\end{ExampleCode}
\end{Examples}

