readPairs                package:HELP                R Documentation

_R_e_a_d _N_i_m_b_l_e_g_e_n ._p_a_i_r _f_i_l_e_s

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

     Function to extract data from corresponding files in the Nimblegen
     .pair format.

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

     readPairs(x, y, z, ...)

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

       x: the name of the file containing data from signal channel 1.
          Each line of the file is interpreted as a single data point.
          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,
          'x' can be a readable connection (which will be opened for
          reading if necessary, and if so closed at the end of the
          function call).   'x' can also be a complete URL. 

       y: the name of the file containing data from signal channel 1.
          Each line of the file is interpreted as a single data point.
          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,
          'y' can be a readable connection (which will be opened for
          reading if necessary, and if so closed at the end of the
          function call).   'y' can also be a complete URL. 

       z: object in which to store pair information from files. Can be
          an 'ExpressionSet', in which case pair data will be stored in
          'featureData'. 

     ...: Arguments to be passed to methods (see 'readPairs-methods'):

     '_n_a_m_e' character input specifying a sample name to assign to the
          data from specified pair files. If 'NULL' (default), a value
          will be extracted from the filename specified in 'x'.

     '_e_l_e_m_e_n_t._x' which element of 'AssayData' (default is '"exprs"') in
          which to store signal channel 1 data.

     '_e_l_e_m_e_n_t._y' which element of 'AssayData' (default is '"exprs2"')
          in which to store signal channel 2 data.

     '_m_a_t_c_h._p_r_o_b_e_s' logical specifying whether to match data from pair
          files by '"PROBE_ID"' with any pre-existing data. if 'TRUE'
          (default), order of values will be rearranged so long as
          there are already '"PROBE_ID"'s specified in 'featureData'.

     '_p_a_t_h' a character vector containing a single full path name to
          which filenames will be appended. If 'NULL', filenames ('x'
          and 'y') are treated as is. 

     '_c_o_m_m_e_n_t._c_h_a_r' character: a character vector of length one
          containing a single character or an empty string (default is
          '"#"'). Use '""' to turn off the interpretation of comments
          altogether. 

     '_s_e_p' the field separator character (default is '"\t"'). 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. 

     '_q_u_o_t_e' the set of quoting characters (default is '"\""'). To
          disable quoting altogether, use 'quote = ""'. See 'scan' for
          the behaviour on quotes embedded in quotes. Quoting is only
          considered for columns read as character, which is all of
          them unless 'colClasses' is specified. 

     '_e_S_e_t' 'ExpressionSet' input (default is 'new("ExpressionSet")')
          in which to store pair information in 'assayData' 

     '_v_e_r_b_o_s_e' logical; if 'TRUE' (default) progress will be output to
          screen. If 'FALSE', no output will be displayed.

     '...' other arguments to be passed to 'read.table'. See
          'read.table'.  

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

     Returns an 'ExpressionSet' filled with 'assayData' containing
     matrices of data from both signal channels.

     and 'featureData' containing the following 'featureColumns': 

'SEQ_ID': a vector of characters with container IDs, linking each probe
          to a parent identifier

'PROBE_ID': a vector of characters containing unique ID information for
          each probe

 'CHIPS': a vector of characters with .pair file locations for signal
          channel 1 data 

'CHIPS2': a vector of characters with .pair file locations for signal
          channel 2 data 

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

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

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

     'readPairs-methods', 'read.table'

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

     #demo(pipeline,package="HELP")

     x <- 1:500
     y <- rev(x)
     data <- sample(8000:10000/1000,size=500)
     seqids <- sample(1:50,size=500,replace=TRUE)
     cat("#COMMENT\nSEQ_ID\tPROBE_ID\tX\tY\tPM\n",file="./read.pair.test.1")
     table.1 <- cbind(seqids,y,x,x,data)
     write.table(table.1,file="./read.pair.test.1",append=TRUE,col.names=FALSE,row.names=FALSE,quote=FALSE,sep="\t")
     cat("#COMMENT\nSEQ_ID\tPROBE_ID\tX\tY\tPM\n",file="./read.pair.test.2")
     table.2 <- cbind(seqids,y,x,x,rev(data))
     write.table(table.2,file="./read.pair.test.2",append=TRUE,col.names=FALSE,row.names=FALSE,quote=FALSE,sep="\t")
     x <- readPairs("./read.pair.test.1","./read.pair.test.2")
     c(seqids[1],y[1],data[1],rev(data)[1])
     pData(featureData(x))$"SEQ_ID"[1]
     pData(featureData(x))$"PROBE_ID"[1]
     assayDataElement(x, "exprs")[1]
     assayDataElement(x, "exprs2")[1]

     #rm(table.1,table.2,x,y,data,seqids)
     #file.remove("./read.pair.test.1")
     #file.remove("./read.pair.test.2")

