Last data update: 2014.03.03

R: Reads a spatial subset of probe-level data from Affymetrix...
readCelRectangleR Documentation

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

Description

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

Usage

readCelRectangle(filename, xrange=c(0, Inf), yrange=c(0, Inf), ..., asMatrix=TRUE)

Arguments

filename

The pathname of the CEL 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 readCel().

asMatrix

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

Value

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

Author(s)

Henrik Bengtsson

See Also

The readCel() method is used internally.

Examples

##############################################################
if (require("AffymetrixDataTestFiles")) {            # START #
##############################################################

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


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


# Read CEL intensities in the upper left corner
cel <- readCelRectangle(file, xrange=c(0,250), yrange=c(0,250))
z <- rotate270(cel$intensities)
sub <- paste("Chip type:", cel$header$chiptype)
image(z, col=gray.colors(256), axes=FALSE, main=basename(file), 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)

# Clean up
rm(rotate270, files, file, cel, z, sub)


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

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(affxparser)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/affxparser/readCelRectangle.Rd_%03d_medium.png", width=480, height=480)
> ### Name: readCelRectangle
> ### Title: Reads a spatial subset of probe-level data from Affymetrix CEL
> ###   files
> ### Aliases: readCelRectangle
> ### Keywords: file IO
> 
> ### ** Examples
> 
> ##############################################################
> if (require("AffymetrixDataTestFiles")) {            # START #
+ ##############################################################
+ 
+ rotate270 <- function(x, ...) {
+   x <- t(x)
+   nc <- ncol(x)
+   if (nc < 2) return(x)
+   x[,nc:1,drop=FALSE]
+ }
+ 
+ 
+ # Search for some available CEL files
+ path <- system.file("rawData", package="AffymetrixDataTestFiles")
+ file <- findFiles(pattern="[.](cel|CEL)$", path=path, recursive=TRUE)
+ 
+ 
+ # Read CEL intensities in the upper left corner
+ cel <- readCelRectangle(file, xrange=c(0,250), yrange=c(0,250))
+ z <- rotate270(cel$intensities)
+ sub <- paste("Chip type:", cel$header$chiptype)
+ image(z, col=gray.colors(256), axes=FALSE, main=basename(file), 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)
+ 
+ # Clean up
+ rm(rotate270, files, file, cel, z, sub)
+ 
+ 
+ ##############################################################
+ }                                                     # STOP #
Loading required package: AffymetrixDataTestFiles
Warning message:
In rm(rotate270, files, file, cel, z, sub) : object 'files' not found
> ##############################################################
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>