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:

     for (zzz in 0) {

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

     # Scan current directory for CEL files
     files <- list.files(pattern="[.](c|C)(e|E)(l|L)$")
     files <- files[!file.info(files)$isdir]
     if (length(files) == 0)
       break

     celFile <- files[1];

     # Read CEL intensities in the upper left corner
     cel <- readCelRectangle(celFile, 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=celFile, 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, celFile, cel, z, sub)

     } # for (zzz in 0)

