modelMatrix              package:limma              R Documentation

_C_o_n_s_t_r_u_c_t _D_e_s_i_g_n _M_a_t_r_i_x

_D_e_s_c_r_i_p_t_i_o_n:

     Construct design matrix from RNA target information for a two
     colour microarray experiment.

_U_s_a_g_e:

     modelMatrix(targets, parameters, ref, verbose=TRUE)
     uniqueTargets(targets)

_A_r_g_u_m_e_n_t_s:

 targets: matrix or data.frame with columns 'Cy3' and 'Cy5' specifying
          which RNA was hybridized to each array

parameters: matrix specifying contrasts between RNA samples which
          should correspond to regression coefficients. Row names
          should correspond to unique RNA sample names found in
          'targets'.

     ref: character string giving name of one of the RNA sources to be
          treated as reference. Exactly one argument of 'parameters' or
          'ref' should be specified.

 verbose: logical, if 'TRUE' then unique names found in 'targets' will
          be printed to standard output

_D_e_t_a_i_l_s:

     This function computes a design matrix for input to 'lmFit' when
     analysing two-color microarray experiments in terms of log-ratios.

     If the argument 'ref' is used, then the experiment is treated as a
     one-way layout and the coefficients measure expression changes
     relative to the RNA source specified by 'ref'. The RNA source
     'ref' is often a common reference which appears on every array or
     is a control sample to which all the others are compared. There is
     no restriction however. One can choose 'ref' to be any of the RNA
     sources appearing the 'Cy3' or 'Cy5' columns of 'targets'.

     If the 'parameters' argument is set, then the columns of this
     matrix specify the comparisons between the RNA sources which are
     of interest. This matrix must be of size n by (n-1), where n is
     the number of unique RNA sources found in 'Cy3' and 'Cy5', and
     must have row names which correspond to the RNA sources.

_V_a_l_u_e:

     'modelMatrix' produces a numeric design matrix with row names as
     in 'targets' and column names as in 'parameters'.

     'uniqueTargets' produces a character vector of unique target names
     from the columns 'Cy3' and 'Cy5' of 'targets'.

_A_u_t_h_o_r(_s):

     Gordon Smyth

_S_e_e _A_l_s_o:

     'model.matrix' in the stats package.

     An overview of linear model functions in limma is given by
     06.LinearModels.

_E_x_a_m_p_l_e_s:

     targets <- cbind(Cy3=c("Ref","Control","Ref","Treatment"),Cy5=c("Control","Ref","Treatment","Ref"))
     rownames(targets) <- paste("Array",1:4)

     parameters <- cbind(C=c(-1,1,0),T=c(-1,0,1))
     rownames(parameters) <- c("Ref","Control","Treatment")

     modelMatrix(targets, parameters)
     modelMatrix(targets, ref="Ref")

