readCdfBin              package:dChipIO              R Documentation

_R_e_a_d_s _a _d_C_h_i_p _C_D_F._b_i_n _f_i_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     Reads a dChip CDF.bin file.

     Please note that this method is incomplete as it currently doesn't
     read all fields.  It is only made available so that someelse can
     continue the development.

_U_s_a_g_e:

     readCdfBin(con, units=NULL, ...)

_A_r_g_u_m_e_n_t_s:

     con: A 'connection' or a 'character' filename.

   units: An 'integer' 'vector' specifying the units to be read. If
          'NULL', all units are read.

     ...: Not used.

_V_a_l_u_e:

     Returns a 'list' structure containing the file header and the unit
     data.

_A_u_t_h_o_r(_s):

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

_S_e_e _A_l_s_o:

     To read only the CDF.bin file header, see 'readCdfBinHeader'().

_E_x_a_m_p_l_e_s:

     path <- system.file("exData", package="dChipIO")
     chipType <- "Test3"
     filename <- sprintf("%s.CDF.bin", chipType)
     pathname <- file.path(path, filename)

     hdr <- readCdfBinHeader(pathname)
     print(hdr)

     data <- readCdfBin(pathname)
     str(data)

     # Read a subset of the units
     units <- c(10:11, 15:20, 150:105, 2,2,2)
     dataT <- readCdfBin(pathname, units=units)
     str(dataT)

     # Assert correctness
     for (ff in c("unitNames", "numProbes", "CellPos")) {
       stopifnot(length(dataT[[ff]]) == length(units))
       stopifnot(identical(dataT[[ff]], data[[ff]][units]))
     }

