readApdUnits {aroma.apd} | R Documentation |
Reads Affymetrix probe data (APD) as units (probesets)
Description
Reads Affymetrix probe data (APD) as units (probesets) by using the unit and group definitions in the corresponding Affymetrix CDF file.
If more than one APD file is read, all files are assumed to be of the same chip type, and have the same read map, if any. It is not possible to read APD files of different types at the same time.
Usage
## Default S3 method:
readApdUnits(filenames, units=NULL, ..., transforms=NULL, cdf=NULL,
stratifyBy=c("nothing", "pmmm", "pm", "mm"), addDimnames=FALSE, readMap="byMapType",
dropArrayDim=TRUE, verbose=FALSE)
Arguments
filenames |
The filenames of the APD files. All APD files must be of the same chip type. |
units |
An |
... |
Additional arguments passed to |
transforms |
A |
cdf |
A |
stratifyBy |
Argument passed to low-level method
|
addDimnames |
If |
readMap |
A |
dropArrayDim |
If |
verbose |
See |
Value
A named list
where the names corresponds to the names of the units
read. Each element of the list
is in turn a list
structure
with groups (aka blocks).
Speed
Since the cell indices are semi-randomized across the array and
with units (probesets), it is very unlikely that the read will
consist of subsequent cells (which would be faster to read).
However, the speed of this method, which uses FileVector
to read data, is comparable to the speed of
readCelUnits
, which uses the Fusion SDK
(readCel
) to read data.
Author(s)
Henrik Bengtsson
See Also
To read CEL units, readCelUnits
.
Internally, the readApd
() method is used for read probe data,
and readApdMap
(), if APD file has a map type specified and
the read map was not given explicitly.
Examples
library("R.utils") # Arguments
verbose <- Arguments$getVerbose(TRUE)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 1. Scan for existing CEL files
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# a) Scan current directory for CEL files
files <- list.files(pattern="[.](cel|CEL)$")
files <- files[!file.info(files)$isdir]
if (length(files) > 0 && require("affxparser")) {
# b) Corresponding APD filenames
celNames <- files
apdNames <- gsub(pattern, ".apd", files)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 1. Copy the probe intensities from a CEL to an APD file
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
for (kk in 1) {
verbose && enter(verbose, "Reading CEL file #", kk)
cel <- readCel(celNames[kk])
verbose && exit(verbose)
if (!file.exists(apdNames[kk])) {
verbose && enter(verbose, "Creating APD file #", kk)
chipType <- cel$header$chiptype
writeApd(apdNames[kk], data=cel$intensities, chipType=chipType)
verbose && exit(verbose)
}
verbose && enter(verbose, "Verifying APD file #", kk)
apd <- readApd(apdNames[kk])
verbose && exit(verbose)
stopifnot(identical(apd$intensities, cel$intensities))
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 2. Read a subset of the units
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
units <- c(1, 20:205)
cel <- readCelUnits(celNames[1], units=units)
apd <- readApdUnits(apdNames[1], units=units)
stopifnot(identical(apd, cel))
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 3. The same, but stratified on PMs and MMs
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
apd <- readApdUnits(apdNames[1], units=units, stratifyBy="pmmm",
addDimnames=TRUE)
} # if (length(files) > 0)