readBaseFile           package:aroma.Base           R Documentation

_L_o_w-_l_e_v_e_l _f_u_n_c_t_i_o_n _t_o _r_e_a_d _a _B_A_S_E _f_i_l_e (_s_t_r_e_a_m) _f_r_o_m _a _c_o_n_n_e_c_t_i_o_n _o_r _a _f_i_l_e

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

     Low-level function to read a BASE file (stream) from a connection
     or a file.

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

     ## Default S3 method:
     readBaseFile(con, ..., verbose=FALSE)

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

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

     ...: Arguments such as the important 'extractSpotsData', passed to
          'readBaseFileSection'().

 verbose: Either a 'logical', a 'numeric', or a 'Verbose' object
          specifying how much verbose/debug information is written to
          standard output. If a Verbose object, how detailed the
          information is is specified by the threshold level of the
          object. If a numeric, the value is used to set the threshold
          of a new Verbose object. If 'TRUE', the threshold is set to
          -1 (minimal). If 'FALSE', no output is written (and neither
          is the R.utils package required). 

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

     Returns a named 'list' structure containing the parsed BASE
     structure. The names of the elements in the list are the same as
     the names (types) of the sections as given by section header
     'section'.

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

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

_R_e_f_e_r_e_n_c_e_s:

     [1] BASE - BioArray Software Environment,
      <URL: http://base.thep.lu.se/>

     [2] Carl Troein, How to write a plugin for BASE, April 2003.
      <URL:
     http://base.thep.lu.se/documentation/development/plugins.txt>
      <URL:
     http://opensource.microarray.omrf.org/wiki/bin/view/BASE/PluginWritingHowto>

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

     'writeBaseFile'(). 'readBaseFileSection'(). See 'stdin()' in
     showConnections to read from standard input.

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

     # Read a simple BASE file structure (adopted from [2])
     filename <- system.file("data-ex", "baseExample.base", package="aroma.Base")
     base <- readBaseFile(filename)
     print(base)

     # Write it back to file
     tmpfile <- tempfile()
     writeBaseFile(tmpfile, base)

     # Read the newly create file
     base2 <- readBaseFile(tmpfile)
     file.remove(tmpfile)

     # Compare with the original structure
     stopifnot(equals(base, base2))

