convertCdf {affxparser} | R Documentation |
Converts a CDF into the same CDF but with another format. Currently only CDF files in version 4 (binary/XDA) can be written. However, any input format is recognized.
convertCdf(filename, outFilename, version="4", force=FALSE, ..., .validate=TRUE, verbose=FALSE)
filename |
The pathname of the original CDF file. |
outFilename |
The pathname of the destination CDF file. If the same as the source file, an exception is thrown. |
version |
The version of the output file format. |
force |
If FALSE , and the version of the orignal CDF is the
same as the output version, the new CDF will not be generated,
otherwise it will. |
... |
Not used. |
.validate |
If 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. |
verbose |
If TRUE , extra details are written while processing. |
Returns (invisibly) TRUE
if a new CDF was generated, otherwise FALSE
.
Binary CDFs are much faster to read than ASCII CDFs. Here are some example for reading complete CDFs (the differnce is even larger when reading CDFs in subsets):
The following chip types have been converted using convertCdf()
and then verified for correctness using compareCdfs()
:
ASCII-to-binary: HG-U133A, Hu6800.
Binary-to-binary: Test3.
Henrik Bengtsson (http://www.braju.com/R/)
See compareCdfs
() to compare two CDF files.
writeCdf
().
for (zzz in 0) { # Find the small 'Test3' CDF file cdfFile <- findCdf("Test3") # Find any CDF file if (is.null(cdfFile)) cdfFile <- findCdf() if (is.null(cdfFile)) break # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Create an identical CDF structure # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cdfHeader <- readCdfHeader(cdfFile) outFile <- sprintf("%s-copy.cdf", cdfHeader$chiptype) convertCdf(cdfFile, outFile, overwrite=TRUE, verbose=TRUE) # Clean up rm(cdfFile, cdfHeader) } # for (zzz in 0)