\HeaderA{plotSpikeRG}{plot spike intensity R vs G}{plotSpikeRG}
\keyword{hplot}{plotSpikeRG}
\begin{Description}\relax
plot red intensity vs green intensity of spikes.
\end{Description}
\begin{Usage}
\begin{verbatim}
plotSpikeRG(spike,parameter,RG,array = 1, bc = FALSE, area = TRUE,
            xlab = "log(Rintensity)", ylab = "log(Gintensity)",
            main = colnames(spike$R)[array], onlycalib = FALSE, 
            xlim = NULL, ylim = NULL, pch = 19, cex = 0.3, col = "black", 
            allpch = 19, allcex = 0.05, allcol = "lightgrey", diag = TRUE,
            diagcol = "grey", diaglwd = 1, curvecol = "blue",
            curvelwd = 1.5, calibtype = 1, adjusttype = 4, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{spike}] a \code{\LinkA{SpikeList}{SpikeList}} object.
\item[\code{parameter}] a \code{\LinkA{ParameterList}{ParameterList} object.}.
If \code{parameter} argument is sepcified, model curves are shown on the plot. 
\item[\code{RG}] a \code{\LinkA{RGList\_CALIB}{RGList.Rul.CALIB} object}. If \code{parameter}
argument is specified, this argument is obligated. More description in Detail section.
\item[\code{array}] integer giving the array to be plotted. 
\item[\code{bc}] a logical value. \code{TRUE} means background corrected measured 
intensities are used. Default is \code{FALSE}.
\item[\code{area}] a logical value. \code{TRUE} means spot area is used to calculate 
measured intensities. Namly, measured intensities are calculated by 
foreground intensities(or background corrected intensities, if bc is 
\code{TRUE}) multiply spot area. \code{FALSE} means spot area is not used.
Default is \code{TRUE}.
\item[\code{xlab}] a title for the x axis.
\item[\code{ylab}] a title for the y axis.
\item[\code{main}] an overall title for the plot.
\item[\code{onlycalib}] a logical value. \code{TRUE} means only the calibration controls are on 
the plot. \code{FALSE} means to plot all the spikes
\item[\code{xlim}] the x limits (min,max) of the plot.
\item[\code{ylim}] the y limits (min,max) of the plot.
\item[\code{pch}] an integer code for one of a set of plotting characters
or symbols for the spike data set. Default is 21.
\item[\code{cex}] a numerical value giving the amount by which the points which 
indicate spike data set should be scaled relative to the default.
Default is 0.3.
\item[\code{col}] the color of the points indicating spike data set. Default is black.
\item[\code{allpch}] an integer code for one of a set of plotting characters
or symbols for the spike data set. Default is 19. 
\item[\code{allcex}] a numerical value giving the amount by which the points which 
indicate all data set should be scaled relative to the default. Default is 0.05. 
\item[\code{allcol}] the color of the points indicating all data set. Default is lightgrey.
\item[\code{diag}] a logical value. Add diagonal on the plot if it is \code{TRUE}.
Default is \code{TRUE}.
\item[\code{diagcol}] the color of the diagonal. Default is grey.
\item[\code{diaglwd}] the width of the diagonal. Default is 1.
\item[\code{curvecol}] the color of the model curves. Default is blue.
\item[\code{curvelwd}] the width of the model curves for calibration
control spikes. Default is 1.5.
\item[\code{calibtype}] the line type of the model curves for 
calibration control spikes. Default is 1.
\item[\code{adjusttype}] the line type of the model curves (using parameter after
adjustment) for calibration control spikes. Default is 4.
\item[\code{...}] other graphical parameters can be used in function \code{\LinkA{plot}{plot}}. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The function plots red vs green measured intensities of spikes of one array. 
The argument \code{array} gives the array index to be plotted. 

If parameter estimation is done, the model curves can be plotted by giving
the argument \code{parameter}. And if the argument \code{parameter} is specified,
the argument \code{RG} is obligated. The combination of these two arguments is
used to compare how the model fits to the spike and to the whole data set. More
details about the usage of this function refers to the readme file of this package.

It supports different ways to calculate the measured intensities. 
Arguments \code{bc} and \code{area} are logical and their combinations are used 
for specifying four differents ways. \code{bc} indicates using background correction
or not. \code{area} indicates multipling spot area or not. The default value
of these two arguments are \code{bc} = FALSE and \code{area} = TRUE. 

see other graphic functions for the other arguments.
\end{Details}
\begin{Value}
A plot is created on the current graphics device.
\end{Value}
\begin{Author}\relax
Hui Zhao
\end{Author}
\begin{Examples}
\begin{ExampleCode}
# load data: spike
data(spike)

# specify the array to be plotted.
array <- 1

# use the default values for other arguments
plotSpikeRG(spike,array=array)

# after parameter estimation, the model curves can be shown on the plot.
data(parameter)
data(RG)
plotSpikeRG(spike,parameter,RG)

\end{ExampleCode}
\end{Examples}

