\HeaderA{meanSdPlot}{Plot row standard deviations versus row means}{meanSdPlot}
\aliasA{meanSdPlot,ExpressionSet-method}{meanSdPlot}{meanSdPlot,ExpressionSet.Rdash.method}
\aliasA{meanSdPlot,matrix-method}{meanSdPlot}{meanSdPlot,matrix.Rdash.method}
\aliasA{meanSdPlot,vsn-method}{meanSdPlot}{meanSdPlot,vsn.Rdash.method}
\aliasA{meanSdPlot-methods}{meanSdPlot}{meanSdPlot.Rdash.methods}
\keyword{hplot}{meanSdPlot}
\keyword{methods}{meanSdPlot}
\begin{Description}\relax
Methods for objects of classes
\code{\LinkA{matrix}{matrix}}, 
\code{\LinkA{ExpressionSet}{ExpressionSet}} and
\code{\LinkA{vsn}{vsn.Rdash.class}}
to plot row standard deviations versus row means.
\end{Description}
\begin{Usage}
\begin{verbatim}
meanSdPlot(x, 
           ranks = TRUE,
           xlab  = ifelse(ranks, "rank(mean)", "mean"),
           ylab  = "sd",
           pch   = ".",
           plot  = TRUE,
           ...)\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] An object of class
\code{\LinkA{matrix}{matrix}}, 
\code{\LinkA{ExpressionSet}{ExpressionSet}}, or
\code{\LinkA{vsn}{vsn.Rdash.class}}.
\item[\code{ranks}] Logical, indicating whether the x-axis (means) should be plotted
on the original scale (\code{FALSE}) or on the rank scale (\code{TRUE}). The latter
distributes the data more evenly along the x-axis and allows a
better visual assessment of the standard deviation as a function of 
the mean.
\item[\code{xlab}] Character, label for the x-axis.
\item[\code{ylab}] Character, label for the y-axis.
\item[\code{pch}] Plot symbol.
\item[\code{plot}] Logical.  If \code{TRUE} (default), a plot is produced.
Calling the function with \code{plot=FALSE} can be useful if only
its return value is of interest.
\item[\code{...}] Further arguments that get passed to plot.default.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Standard deviation and mean are calculated row-wise from the
expression matrix (in) \code{x}. The scatterplot of these versus each other
allows to visually verify whether there is a dependence of the standard
deviation (or variance) on the mean.
The red dots depict the running median estimator (window-width 10\%).
If there is no variance-mean dependence, then the line formed by the
red dots should be approximately horizontal.
\end{Details}
\begin{Value}
A named list with two components, containing x-positions and values of
the running median estimator (the red dots in the plot).
The methods can also have a side effect, which is to create a plot on the
active graphics device.
\end{Value}
\begin{Author}\relax
Wolfgang Huber \url{http://www.ebi.ac.uk/huber}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{vsn}{vsn}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  data(kidney)
  log.na = function(x) log(ifelse(x>0, x, NA))

  exprs(kidney) = log.na(exprs(kidney))
  meanSdPlot(kidney)

  ## ...try this out with non-logged data, the lymphoma data, your data...
\end{ExampleCode}
\end{Examples}

