\HeaderA{selSpots}{Select spots to use in normalisation}{selSpots}
\keyword{classes}{selSpots}
\begin{Description}\relax
Function to select spots to be used in microarray normalisation.
\end{Description}
\begin{Usage}
\begin{verbatim}
selSpots(obj=NULL, sigNoise=1, rmFlag=NULL, gLabelsID=c("Name"),
         remove=list(c("BLANK","DAP","LYS","PHE","Q_GENE","THR","TRP")),
         badSpots=NULL, badLabel=NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{obj}] object of class \code{\LinkA{maigesRaw}{maigesRaw}}.
\item[\code{sigNoise}] positive real number indicating the cutoff to remove
spots with signal-to-noise ratio below it.
\item[\code{rmFlag}] vector of flag symbols to be removed (for
normalisation). These flags are stored in the slot \code{Flags} from
\code{\LinkA{maigesRaw}{maigesRaw}} class.
\item[\code{gLabelsID}] character vector indicating the gene labels to be
searched to exclude that ones specified in \code{remove} argument.
\item[\code{remove}] list of same length as \code{GlabelsID} containing character
vector indicating the symbols of spots to be removed, according to
the \code{GlabelsID} argument.
\item[\code{badSpots}] index of bad spots (numeric or logical) identifying
bad spots. May be the gene labels, with label ID specified by the
argument \code{badLabel}.
\item[\code{badLabel}] character string specifying the gene label ID for
remove \code{badSpots}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function takes the object of class \code{\LinkA{maigesRaw}{maigesRaw}} and
actualise the slot \code{UseSpots} according with the arguments passed
to the function. This slot is read by the normalisation functions
\code{\LinkA{normLoc}{normLoc}}, \code{\LinkA{normOLIN}{normOLIN}},
\code{\LinkA{normRepLoess}{normRepLoess}}, \code{\LinkA{normScaleLimma}{normScaleLimma}} and
\code{\LinkA{normScaleMarray}{normScaleMarray}} to use only the spots that passed the
criteria specified here.
\end{Details}
\begin{Value}
This function returns another object of class \code{\LinkA{maigesRaw}{maigesRaw}}
with the \code{UseSpots} slot actualised.
\end{Value}
\begin{Author}\relax
Gustavo H. Esteves <\email{gesteves@vision.ime.usp.br}>
\end{Author}
\begin{Examples}
\begin{ExampleCode}
## Loading the dataset
data(gastro)

## Filtering all spots with signal2noise ratio (Sf/Sb or Rf/Rb) greater
## or equal to 1 and that have 'Name' label as 'BLANK', 'DAP', ..., 'TRP'.
gastro.raw2 = selSpots(gastro.raw, sigNoise=1, rmFlag=NULL, gLabelsID="Name",
  remove=list(c("BLANK","DAP","LYS","PHE","Q_GENE","THR","TRP")))

## To see the number of spots that suvived the filtering above do
apply(gastro.raw2@UseSpots, 2, sum)

## To do the same filtering as above, also filtering flags marcke as 1
## and 4 do
gastro.raw2 = selSpots(gastro.raw, sigNoise=1, rmFlag=c(1,4), gLabelsID="Name",
  remove=list(c("BLANK","DAP","LYS","PHE","Q_GENE","THR","TRP")))

apply(gastro.raw2@UseSpots, 2, sum)
\end{ExampleCode}
\end{Examples}

