\HeaderA{plot.twilight}{A plot function for twilight objects}{plot.twilight}
\keyword{hplot}{plot.twilight}
\begin{Description}\relax
Interface to plotting of \code{twilight} objects. Produces one of five possible plots.
\end{Description}
\begin{Usage}
\begin{verbatim}plot.twilight(x, which = "fdr", grayscale = FALSE, legend = TRUE, ...)\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] An object of class twilight. 
\item[\code{which}] A character string specifying the plot to be made. 
\item[\code{grayscale}] Logical value. Specifying whether plots should be colored or grayscaled. Only necessary for "scores" and "fdr". 
\item[\code{legend}] Logical value. Produces a legend for "scores" and "effectsize". A legend for "fdr" is only available if bootstrap estimates exist. 
\item[\code{...}] Additional graphical arguments. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Option \code{which="scores"} plots the expected versus the observed test statistics and draws confidence lines calculated from permutations. This plot is similar to plots in Tusher et al. (2001).

Option \code{which="qvalues"} plots \eqn{q}{}-values versus the number of rejected hypotheses.

Option \code{which="fdr"} plots \eqn{u}{}-values versus 1 - local false discovery rate, that is the conditional probability of being significant given the corresponding \eqn{u}{}-value, plus bootstrap estimates if computed. Bottom ticks are 1

Option \code{which="volcano"} results in the volcano plot, that is observed score versus 1 - local false discovery rate. Bottom ticks are 1

Option \code{which="effectsize"} plots the observed fold change equivalent score distribution overlaid by the estimated effect size distribution, that is distribution of scores under the alternative. This plot is only available if function \code{twilight.pval} was applied with \code{method="fc"} as fold change equivalent scores are computed from log ratios.

Option \code{which="table"} tabulates histogram \code{"effectsize"}.
\end{Details}
\begin{Value}
No value is returned except for "table".
\end{Value}
\begin{Author}\relax
Stefanie Scheid \url{http://www.molgen.mpg.de/~scheid}
\end{Author}
\begin{References}\relax
Scheid S and Spang R (2004): A stochastic downhill search algorithm for estimating the local false discovery rate, \emph{IEEE TCBB} \bold{1(3)}, 98--108.

Tusher VG, Tibshirani R and Chu G (2001): Significance analysis of mircroarrays applied to the ionizing response, \emph{PNAS} \bold{98(9)}, 5116--5121.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{twilight.pval}{twilight.pval}}, \code{\LinkA{twilight}{twilight}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(exfdr) # contains a twilight object created by twilight
plot(exfdr,which="fdr")
\end{ExampleCode}
\end{Examples}

