\Header{QualityWeights}{Spot Quality Weights}
\alias{wtarea}{QualityWeights}
\alias{wtflags}{QualityWeights}
\alias{wtIgnore.Filter}{QualityWeights}
\keyword{regression}{QualityWeights}
\begin{Description}\relax
Functions to calculate quality weights for individual spots based on image analyis output file.
\end{Description}
\begin{Usage}
\begin{verbatim}
wtarea(ideal=c(160,170))
wtflags(w=0.1)
wtIgnore.Filter
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{ideal}] numeric vector giving the ideal area or range of areas for a spot in pixels
\item[\code{w}] weight to be given to flagged spots
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
These functions can be passed as an argument to \code{read.maimages} to construct quality weights as the microarray data is read in.

\code{wtarea} downweights unusually small or large spots and is designed for SPOT output.
It gives weight 1 to spots which have areas in the ideal range, given in pixels, and linearly downweights spots which are smaller or larger than this range.

\code{wtflags} is designed for GenePix output and gives weight \code{flagged.wt} to spots with \code{Flags} value less than zero. 

\code{wtIgnore.Filter} is designed for QuantArray output and sets the weights equal to the column \code{Ignore Filter} produced by QuantArray.
These weights are 0 for spots to be ignored and 1 otherwise.\end{Details}
\begin{Value}
A function which takes a dataframe or matrix as argument and produces a numeric vector of weights between 0 and 1\end{Value}
\begin{Author}\relax
Gordon Smyth
\end{Author}
\begin{SeeAlso}\relax
An overview of LIMMA functions for reading data is given in \link{3.ReadingData}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
#  Read in spot output files from current directory and give full weight to 165
#  pixel spots.  Note: for this example to run you must set fnames to the names
#  of actual spot output files (data not provided).
## Not run: 
RG <- read.maimages(fnames,source="spot",wt.fun=wtarea(165))
#  Spot will be downweighted according to weights found in RG
MA <- normalizeWithinArrays(RG,layout)
## End(Not run)
\end{ExampleCode}
\end{Examples}

