readCelRectangle         package:affxparser         R Documentation

_R_e_a_d_s _a _s_p_a_t_i_a_l _s_u_b_s_e_t _o_f _p_r_o_b_e-_l_e_v_e_l _d_a_t_a _f_r_o_m _A_f_f_y_m_e_t_r_i_x _C_E_L _f_i_l_e_s

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

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]).

_V_a_l_u_e:

     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.

_A_u_t_h_o_r(_s):

     Henrik Bengtsson (<URL: http://www.braju.com/R/>)

_S_e_e _A_l_s_o:

     The 'readCel'() method is used internally.

_E_x_a_m_p_l_e_s:

     ##############################################################
     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 #
     ##############################################################

