Learn R Programming

aroma.apd (version 0.7.0)

readApdRectangle: Reads a spatial subset of probe-level data from Affymetrix APD files

Description

Reads a spatial subset of probe-level data from Affymetrix APD files.

Usage

# S3 method for default
readApdRectangle(filename, xrange=c(0, Inf), yrange=c(0, Inf), ..., asMatrix=TRUE)

Value

A named list APD structure similar to what readApd(). In addition, if asMatrix is TRUE, the APD data fields are returned as matrices, otherwise not.

Arguments

filename

The pathname of the APD file.

xrange

A numeric vector of length two giving the left and right coordinates of the cells to be returned.

yrange

A numeric vector of length two giving the top and bottom coordinates of the cells to be returned.

...

Additional arguments passed to readApd().

asMatrix

If TRUE, the APD data fields are returned as matrices with element (1,1) corresponding to cell (xrange[1],yrange[1]).

Author

Henrik Bengtsson

See Also

The readApd() method is used internally.

Examples

Run this code

# Local functions
rotate270 <- function(x, ...) {
  x <- t(x)
  nc <- ncol(x)
  if (nc < 2) return(x)
  x[,nc:1,drop=FALSE]
}

# Scan current directory for APD files
files <- list.files(pattern="[.](apd|APD)$")
files <- files[!file.info(files)$isdir]
if (length(files) > 0) {
  apdFile <- files[1]
 
  # Read APD intensities in the upper left corner
  apd <- readApdRectangle(apdFile, xrange=c(0,250), yrange=c(0,250))
  z <- rotate270(apd$intensities)
  sub <- paste("Chip type:", apd$header$chipType)
  image(z, col=gray.colors(256), axes=FALSE, main=apdFile, sub=sub)
  text(x=0, y=1, labels="(0,0)", adj=c(0,-0.7), cex=0.8, xpd=TRUE)
  text(x=1, y=0, labels="(250,250)", adj=c(1,1.2), cex=0.8, xpd=TRUE)
}

Run the code above in your browser using DataLab