\HeaderA{plot.spatial}{Spatial Representation of Microarray Spot Statistics}{plot.spatial}
\aliasA{draw.image.func}{plot.spatial}{draw.image.func}
\aliasA{spatial.func}{plot.spatial}{spatial.func}
\keyword{hplot}{plot.spatial}
\begin{Description}\relax
Creates an image of shades
of gray or colors, that represents the values of a statistic for each
spot on the array. The statistic can be a log intensity ratio, quality
information such as spot size or shape, or a t-statistic. This function
can be used to explore whether there are any spatial effects in the data.
\end{Description}
\begin{Usage}
\begin{verbatim}
plot.spatial(x, layout, crit1=0.05, crit2=crit1, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a numerical vector. This vector can contain any spot 
statistics, such
as log intensity ratios, spot sizes or shapes, or t-statistics.
\item[\code{layout}] a list specifying the dimensions of the spot matrix
and the grid matrix. This can be generated by calling 
\code{\LinkA{init.grid}{init.grid}}.
\item[\code{crit1}] the number of values from x to be displayed on the image. 
If crit1 < 1, the crit1*100\% spots with the largest x values are displayed.
If crit1 >= 1, the crit1 spots with the largest x values are displayed.
\item[\code{crit2}] the number of values from x to be displayed on the
image. If crit2 < 1, the crit2*100\% spots with the largest x values
are displayed. If crit2 >= 1, the crit2 spots with the largest x
values are displayed.
\item[\code{...}] graphical parameters may also be supplied as arguments 
to the function (see \code{\LinkA{par}{par}}).
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The values that didn't meet the criteria are not shown on the image.
The image follows the layout of an actual microarray slide with the
top left corner representing the spot (1,1,1,1).
\end{Details}
\begin{Value}
An image is created on the current graphics device.
\end{Value}
\begin{Note}\relax
\code{\LinkA{draw.image.func}{draw.image.func}} and \code{\LinkA{spatial.func}{spatial.func}}
are called by \code{\LinkA{plot.spatial}{plot.spatial}} and are not typically 
used on their own.
\end{Note}
\begin{Author}\relax
Yee Hwa Yang, \email{yeehwa@stat.berkeley.edu} \\
Sandrine Dudoit, \email{sandrine@stat.berkeley.edu}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{draw.image.func}{draw.image.func}}, \code{\LinkA{init.grid}{init.grid}}, 
\code{\LinkA{spatial.func}{spatial.func}}, \code{\LinkA{image}{image}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(MouseArray)
# mouse.setup <- init.grid()
# mouse.data <- init.data() ## see \emph{init.data}

mouse.lratio <- stat.ma(mouse.data, mouse.setup)
plot.spatial(mouse.lratio$M[,1], mouse.setup) ## default 85

# Looking for areas where the spots are not quite circular
plot.spatial(mouse1[,"shape"], mouse.setup, crit1=0.1)
\end{ExampleCode}
\end{Examples}

