\HeaderA{readCdfDataFrame}{Reads units (probesets) from an Affymetrix CDF file}{readCdfDataFrame}
\keyword{file}{readCdfDataFrame}
\keyword{IO}{readCdfDataFrame}
\keyword{internal}{readCdfDataFrame}
\begin{Description}\relax
Reads units (probesets) from an Affymetrix CDF file. Gets all or a subset of units (probesets).
\end{Description}
\begin{Usage}
\begin{verbatim}readCdfDataFrame(filename, units=NULL, groups=NULL, cells=NULL, fields=NULL, drop=TRUE, verbose=0)\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{filename}] The filename of the CDF file.
\item[\code{units}] An \code{\LinkA{integer}{integer}} \code{\LinkA{vector}{vector}} of unit indices
specifying which units to be read.  If \code{\LinkA{NULL}{NULL}}, all are read.
\item[\code{groups}] An \code{\LinkA{integer}{integer}} \code{\LinkA{vector}{vector}} of group indices
specifying which groups to be read.  If \code{\LinkA{NULL}{NULL}}, all are read.
\item[\code{cells}] An \code{\LinkA{integer}{integer}} \code{\LinkA{vector}{vector}} of cell indices
specifying which cells to be read.  If \code{\LinkA{NULL}{NULL}}, all are read.
\item[\code{fields}] A \code{\LinkA{character}{character}} \code{\LinkA{vector}{vector}} specifying what fields to read.
If \code{\LinkA{NULL}{NULL}}, all unit, group and cell fields are returned.
\item[\code{drop}] If \code{\LinkA{TRUE}{TRUE}} and only one field is read, then a \code{\LinkA{vector}{vector}}
(rather than a single-column \code{\LinkA{data.frame}{data.frame}}) is returned.
\item[\code{verbose}] An \code{\LinkA{integer}{integer}} specifying the verbose level. If 0, the
file is parsed quietly.  The higher numbers, the more details.
\end{ldescription}
\end{Arguments}
\begin{Value}
An NxK \code{\LinkA{data.frame}{data.frame}} or a \code{\LinkA{vector}{vector}} of length N.
\end{Value}
\begin{References}\relax
[1] Affymetrix Inc, Affymetrix GCOS 1.x compatible file formats,
June 14, 2005.
\url{http://www.affymetrix.com/support/developer/}
\end{References}
\begin{SeeAlso}\relax
For retrieving the CDF as a \code{\LinkA{list}{list}} structure, see \code{\LinkA{readCdfUnits}{readCdfUnits}}().
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
##############################################################
if (require("AffymetrixDataTestFiles")) {            # START #
##############################################################

# Find any CDF file
cdfFile <- findCdf()

units <- 101:120
fields <- c("unit", "unitName", "group", "groupName", "cell")
df <- readCdfDataFrame(cdfFile, units=units, fields=fields)
stopifnot(identical(sort(unique(df$unit)), units))

fields <- c("unit", "unitName", "unitType")
fields <- c(fields, "group", "groupName")
fields <- c(fields, "x", "y", "cell", "pbase", "tbase")
df <- readCdfDataFrame(cdfFile, units=units, fields=fields)
stopifnot(identical(sort(unique(df$unit)), units))

##############################################################
}                                                     # STOP #
##############################################################

\end{ExampleCode}
\end{Examples}

