\HeaderA{convertCel}{Converts a CEL into the same CEL but with another format}{convertCel}
\keyword{file}{convertCel}
\keyword{IO}{convertCel}
\begin{Description}\relax
Converts a CEL into the same CEL but with another format.
Currently only CEL files in version 4 (binary/XDA) can be written.
However, any input format is recognized.
\end{Description}
\begin{Usage}
\begin{verbatim}convertCel(filename, outFilename, readMap=NULL, writeMap=NULL, version="4", ..., .validate=FALSE, verbose=FALSE)\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{filename}] The pathname of the original CEL file.
\item[\code{outFilename}] The pathname of the destination CEL file.
If the same as the source file, an exception is thrown.
\item[\code{readMap}] An optional read map for the input CEL file.
\item[\code{writeMap}] An optional write map for the output CEL file.
\item[\code{version}] The version of the output file format.
\item[\code{...}] Not used.
\item[\code{.validate}] If \code{\LinkA{TRUE}{TRUE}}, a consistency test between the generated
and the original CDF is performed.  Note that the memory overhead
for this can be quite large, because two complete CDF structures
are kept in memory at the same time.
\item[\code{verbose}] If \code{\LinkA{TRUE}{TRUE}}, extra details are written while processing.
\end{ldescription}
\end{Arguments}
\begin{Value}
Returns (invisibly) \code{\LinkA{TRUE}{TRUE}} if a new CEL was generated, otherwise \code{\LinkA{FALSE}{FALSE}}.
\end{Value}
\begin{Section}{Benchmarking of ASCII and binary CELs}
Binary CELs are much faster to read than ASCII CELs.  Here are some
example for reading complete CELs (the differnce is even larger when
reading CELs in subsets):
\Itemize{
\item To do
}
\end{Section}
\begin{Author}\relax
Henrik Bengtsson (\url{http://www.braju.com/R/})
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{createCel}{createCel}}().
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
##############################################################
if (require("AffymetrixDataTestFiles")) {            # START #
##############################################################

# Search for some available Calvin CEL files
path <- system.file("rawData", package="AffymetrixDataTestFiles")
files <- findFiles(pattern="[.](cel|CEL)$", path=path, recursive=TRUE, firstOnly=FALSE)
files <- grep("FusionSDK_Test3", files, value=TRUE)
files <- grep("Calvin", files, value=TRUE)
file <- files[1]

outFile <- file.path(tempdir(), gsub("[.]CEL$", ",XBA.CEL", basename(file)))
if (file.exists(outFile))
  file.remove(outFile)
convertCel(file, outFile, .validate=TRUE)

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

\end{ExampleCode}
\end{Examples}

