\HeaderA{plot.LD}{Textual and graphical display of linkage disequilibrium (LD) objects}{plot.LD}
\aliasA{LDView}{plot.LD}{LDView}
\aliasA{plot}{plot.LD}{plot}
\keyword{misc}{plot.LD}
\begin{Description}\relax
Textual and graphical display of linkage disequilibrium (LD) objects
\end{Description}
\begin{Usage}
\begin{verbatim}
plot(x, y, ...)
plot.LD (x, y=NULL, cex, ...)
LDView(LdMat,
       SNPloc=NULL,
       is.triangle=TRUE,
       SNPnames=NULL,
       cexSNPnames=0.2+1/log10(nrow(LdMat)),
       margins=c(6,2,3,6),
       main=NULL,
       barCol=rainbow(256,start=0,end=1/6 ),
       widths=c(10,10),
       heights=c(1,10),
       ...)



\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] LD or LDband object
\item[\code{y}] currently ignored
\item[\code{cex}] Scaling factor for table text. If absent, text will be
scaled to fit within the table cells.
\item[\code{LdMat}] matrix of pair-wise LD measures
\item[\code{SNPloc}] SNP locations
\item[\code{is.triangle}] indicate if 'LdMat' is a lower triangle matrix or not.
if 'LdMat' is an upper triangle, then the user has to
transpose it before calling the function 'LDView'.
\item[\code{SNPnames}] labels for SNPs
\item[\code{cexSNPnames}] font size for SNPs labels
\item[\code{margins}] margins for heatmap
\item[\code{main}] title for the plot
\item[\code{barCol}] specify the color scheme
\item[\code{widths}] The plot is split into two parts -- upper part and lower part
'widths' specifies the widths of the two parts
\item[\code{heights}] The plot is split into two parts -- upper part and lower part
'heights' specifies the heights of the two parts
\item[\code{...}] Optional arguments (\code{plot.LD.data.frame} passes
these to \code{LDtable} and \code{LDplot}) and other parameters for the function 'image'
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
LDtable generates a graphical matrix of LD coefficients.  It attempts
to properly set the font size so that the estimated values fit into
the boxes.  It also colorized the boxes to whether the estimates are
significantly different from no linkage.

LDplot generates a plot of the LD coeffients across markers.  By
default it will overlay plots for LD against all markers.  LD against a
specific subset of markers can be obtained using the \code{marker}
argument.
\end{Details}
\begin{Value}
\begin{ldescription}
\item[\code{SNPnames}] labels of the SNPs in \code{LDView}
\item[\code{LdMat}] LD matrix
\item[\code{SNPloc}] SNP positions
\end{ldescription}
\end{Value}
\begin{Author}\relax
Gregory R. Warnes \email{warnes@bst.rochester.edu}
\end{Author}
\begin{SeeAlso}\relax
\code{LD}, \code{geneSet}, \code{diseq}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

# load the data
data(CAMP)

# compute pairwise LD
ld <- LD(CAMP)

print(ld)    # text display of LD coefficents and graphical display of LD estimates

LDView(t(ld@"R^2"), SNPloc=1:8, SNPnames=CAMP@markerInfo$Name)

## LDtable(ld) # graphical display of LD estimates
## LDtable(ld, which="D'", digits=2) # graphical display of D' only 

## plot(CAMP) # two panel display

\end{ExampleCode}
\end{Examples}

