\name{read.AgilentFE}
\alias{read.AgilentFE}
\title{Read Agilent Feature Extraction *.txt data files}
\description{
	Read the data files generated by the Agilent Feature
	Extraction image analysis software 
}
\usage{
	read.AgilentFE(targets, makePLOT)
}
\arguments{
  \item{targets}{
	A data frame that specifies experimental conditions
	under which each sample has been obtained.  
	 }
  \item{makePLOT}{
	logical, if \code{TRUE} the function display boxplots
	and density plots of foreground 'ProcessedSignal' and
	'MeanSignal' and background 'BGMedianSignal' and 
	'BGUsed' 
	}
}
\details{

	The function reads the *.txt files generated by the 
	AFE Software using the 'read.maimages' function 
	of 'limma' package.  

	Data, colected with the Agilent Feature Extraction Software, are stored
        in a RGList object with the following components:
        \tabular{ll}{
		dd\$R: \tab                      'gProcessedSignal' \cr
                dd\$G: \tab                       'gMeanSignal'\cr
                dd\$Rb:  \tab                     'gBGMedianSignal'\cr
                dd\$Gb:  \tab                     'gBGUsed'\cr
                dd\$targets: \tab                  'targets'\cr
                dd\$genes\$ProbeName:  \tab        'Probe Name'\cr
                dd\$genes\$GeneName: \tab          'Gene Name'\cr
                dd\$genes\$SystematicName:  \tab   'Systematic Name'\cr
                dd\$genes\$Description:    \tab    'Description Name'\cr
                dd\$genes\$Sequence:  \tab         '60 bases Sequence'\cr
                dd\$genes\$ControlType: \tab       'FLAG to specify the sort of feature'\cr
                dd\$other\$gIsWellAboveBG: \tab     'FLAG IsWellAboveBG'\cr
                dd\$other\$gIsFound: \tab          'FLAG IsFound'\cr
                dd\$other\$gIsSaturated: \tab      'FLAG IsSaturated'\cr
                dd\$other\$gIsFeatPopnOL: \tab     'FLAG IsFeatPopnOL'\cr
                dd\$other\$gIsFeatNonUnifOL: \tab  'FLAG IsFeatNonUnifOL'\cr
                dd\$other\$chr\_coord: \tab        'CHR coordinate (from Agilent
		data files)
       }

     
	  'MeanSignal' is the spot Raw mean signal. 'ProcessedSignal' is the signal processed by the AFE software 
        analysis software (AFE). It contains the  Multiplicatively Detrend Bacground
        Substracted Signal if detrending option is selected and it helps. If the detrending
        does not help, the 'ProcessedSignal' will be the Bacground Subtracted Signal.
        'BGMedianSignal' is the Median local background signal.
        'BGUsed' depends on the AFE settings for the type of background method and the
        setting for the spatial detrend. Usually, the Background Signal Used is the sum
        of the local bacground + the spatial detrending surface value computed by
        the AFE software. To view the values used to calculate this variable using
        different bakground signals and settings of spatial detrend and global background
        adjust, see Table 33 on page 213 in the AFE reference guide.

        Later, if a BioC annotation package is provided, 'SystematicName', 'GeneName'
        and 'Description' fields are replaced, respectively,  by the corresponding ACCNUM, SYMBOL
        and DESCRIPTION obtained from the annotation package.
}
\value{
 An RGList containing: 
  \item{RGList\$Rf}{matrix, 'gProcessedSignal'}
  \item{RGList\$Gf}{matrix, 'gMeanSignal'}
  \item{RGList\$Rb}{matrix, 'gBGMedianSignal'}
  \item{RGList\$Gb}{matrix, 'gBGUsed'}
  \item{RGList\$targets}{data.frame, 'FileName'}
  \item{RGList\$genes\$ProbeName}{character, 'AGilent Probe Name'}
  \item{RGList\$genes\$GeneName}{character, 'Symbol Gene Name'}
  \item{RGList\$genes\$SystematicName}{character, 'Systematic Gene Name'}
  \item{RGList\$genes\$Description}{character, 'Gene Description'}
  \item{RGList\$genes\$Sequence}{character, 'Sequence of the 60 mer probe'}
  \item{RGList\$genes\$ControlType}{integer, '0'= Feature, '1'= Positive control, '-1'= Negative control}
  \item{RGList\$other\$gIsWellAboveBG}{matrix, FLAG to classify signal if 'IsWellAboveBG=1' or 'not=0'}
  \item{RGList\$other\$gIsFound}{matrix, FLAG to classify signal if 'IsFound=1' or 'not=0'}
  \item{RGList\$other\$gIsSaturated}{matrix, FLAG to classify signal if 'IsSaturated = 1' or 'not=0'}
  \item{RGList\$other\$gIsFeatPopnOL}{matrix, FLAG to classify signal if 'IsFeatPopnOL = 0' or 'not=1'}
  \item{RGList\$other\$gIsFeatNonUnifOL}{matrix, FLAG to classify signal if 'gIsFeatNonUnifOL = 0' or 'not=1'}
  \item{RGList\$other\$chr\_coord}{matrix, chr coordinates for the 60 mer Agilent probe}
}
\references{ 
	Agilent Feature Extraction Reference Guide 
	\url{http://www.Agilent.com} 
 }
\author{ Pedro Lopez-Romero }
\seealso{ 
	\code{\link{read.targets}} 
	\code{\link{dd}} 
	\code{\link{targets}} 
}
\examples{
\dontrun{
	dd=read.AgilentFE(targets,makePLOT=TRUE)
}
	data(dd)
}
\keyword{documentation}
\keyword{utilities}