\HeaderA{plotSampleRelation}{visualize the sample relations}{plotSampleRelation}
\keyword{hplot}{plotSampleRelation}
\begin{Description}\relax
plot the sample relations based on MDS or hierarchical clustering
\end{Description}
\begin{Usage}
\begin{verbatim}
plotSampleRelation(x, selProbe = NULL, cv.Th = 0.1, standardize = TRUE, method = c("cluster", "mds"), dimension = c(1, 2), color = NULL, ...)
\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
\item[\code{selProbe}] the selected probes used to determine the sample relations. If not provide, all the probes will be used. 
\item[\code{cv.Th}] the threshold of the coefficient of variance of probes used to select probes to estimate sample relations 
\item[\code{standardize}] standardize the expression profiles or not 
\item[\code{method}] "MDS" or "hierarchical clustering" 
\item[\code{dimension}] the principle components to visualize the MDS plot 
\item[\code{color}] the color for each sample during plot. Only support the "mds" method 
\item[\code{...}] Other parameters used by plot function. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Estimate the sample relations based on selected probes (based on large coefficient of variance (mean / standard variance)). Two methods can be used: MDS (Multi-Dimensional Scaling) or hierarchical clustering methods.
\end{Details}
\begin{Value}
Plot the results or return the distance matrix.
\end{Value}
\begin{Author}\relax
Pan Du
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{lumiQ}{lumiQ}}, \code{\LinkA{LumiBatch}{LumiBatch}}, , \code{\LinkA{plot.LumiBatch}{plot.LumiBatch}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

## load example data
data(example.lumi)

## plot the sample relations with MDS
## the color of sample is automatically set based on the sample type
plotSampleRelation(example.lumi, col=c('100US', '95US:5P', '100US', '95US:5P'))

## plot the sample relations with hierarchical clustering
plotSampleRelation(example.lumi, method='cluster')

\end{ExampleCode}
\end{Examples}

