createCel | R Documentation |
Creates an empty CEL file.
createCel(filename, header, nsubgrids=0, overwrite=FALSE, ..., cdf=NULL, verbose=FALSE)
filename |
The filename of the CEL file to be created. |
header |
A |
overwrite |
If |
nsubgrids |
The number of subgrids. |
... |
Not used. |
cdf |
(optional) The pathname of a CDF file for the CEL file
to be created. If given, the CEL header (argument |
verbose |
An |
Currently only binary (v4) CEL files are supported. The current version of the method does not make use of the Fusion SDK, but its own code to create the CEL file.
Returns (invisibly) the pathname of the file created.
There are a few redundant fields in the CEL header. To make sure the CEL header is consistent, redundant fields are cleared and regenerated. For instance, the field for the total number of cells is calculated from the number of cell rows and columns.
Henrik Bengtsson
##############################################################
if (require("AffymetrixDataTestFiles")) { # START #
##############################################################
# Search for first available ASCII CEL file
path <- system.file("rawData", package="AffymetrixDataTestFiles")
files <- findFiles(pattern="[.](cel|CEL)$", path=path, recursive=TRUE, firstOnly=FALSE)
files <- grep("ASCII", files, value=TRUE)
file <- files[1]
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Read the CEL header
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hdr <- readCelHeader(file)
# Assert that we found an ASCII CEL file, but any will do
stopifnot(hdr$version == 3)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Create a CEL v4 file of the same chip type
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
outFile <- file.path(tempdir(), "zzz.CEL")
if (file.exists(outFile))
file.remove(outFile)
createCel(outFile, hdr, overwrite=TRUE)
str(readCelHeader(outFile))
# Verify correctness by update and re-read a few cells
intensities <- as.double(1:100)
indices <- seq(along=intensities)
updateCel(outFile, indices=indices, intensities=intensities)
value <- readCel(outFile, indices=indices)$intensities
stopifnot(identical(intensities, value))
##############################################################
} # STOP #
##############################################################
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.