readSampleKey              package:HELP              R Documentation

_R_e_a_d _s_a_m_p_l_e _k_e_y

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

     Function to extract sample key data from a file and link chip ID
     information with aliases if they exist.

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

     readSampleKey(file = NULL, chips = NULL, comment.char = "#", sep = "\t")

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

    file: the name of the file containing sample key information. Each
          line of the file is interpreted as a single chip-to-sample
          map. If it does not contain an absolute path, the file name
          is relative to the current working directory, 'getwd()'.
          Tilde-expansion is performed where supported.  Alternatively,
          'file' can be a readable connection (which will be opened for
          reading if necessary, and if so closed at the end of the
          function call).   'file' can also be a complete URL. 

   chips: a character vector specifying a specific chip ID lookup in
          the sample key, for which the function will return the
          appropriate sample aliases 

comment.char: character: a character vector of length one containing a
          single character or an empty string. Use '""' to turn off the
          interpretation of comments altogether. 

     sep: the field separator character. Values on each line of the
          file are separated by this character. If 'sep = ""' the
          separator is "white space", that is one or more spaces, tabs,
          newlines or carriage returns. 

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

     Returns a character vector of sample alias information
     corresponding to the chips present in the sample key or a subset
     thereof, specified by the 'chips' input.

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

     Reid F. Thompson (rthompso@aecom.yu.edu)

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

     'read.table'

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

     #demo(pipeline,package="HELP")

     cat("#COMMENT\nCHIP_ID\tSAMPLE\n",file="./sample.key.txt")
     write.table(cbind(1:10,1001:1010),file="./sample.key.txt",append=TRUE,col.names=FALSE,row.names=FALSE,quote=FALSE,sep="\t")
     readSampleKey(file="./sample.key.txt")
     readSampleKey(file="./sample.key.txt",chips=c(7:10,"NA1","NA2"))

     #file.remove("./sample.key.txt")

