comp.SAM                package:DEDS                R Documentation

_C_o_m_p_u_t_i_n_g _S_A_M _S_t_a_t_i_s_t_i_c_s _f_o_r _D_i_f_f_e_r_e_n_t_i_a_l _E_x_p_r_e_s_s_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     'comp.SAM' returns a function of one argument. This function has a
     environment with bindings for a series of arguments (see below).
     It accepts a microarray data matrix as its single argument, when
     evaluated, computes SAM statistics for each row of the matrix.

_U_s_a_g_e:

     comp.SAM(L = NULL, prob = 0.5, B = 200, stat.only = TRUE, verbose = FALSE,
     deltas, s.step=0.01, alpha.step=0.01, plot.it=FALSE)

_A_r_g_u_m_e_n_t_s:

       L: A vector of integers corresponding to observation (column)
          class labels. For k classes, the labels must be integers
          between 0 and k-1.

    prob: A numeric variable used to set the fudge factor s_0 in terms
          of the percentile of the standard deviations of the genes. If
          set as 'NULL', s_0 is calculated using the algorithm by
          Tusher et al. (see reference).

       B: The number of permutations. For a complete enumeration, 'B'
          should be 0 (zero) or any number not less than the total
          number of permutations.

stat.only: A logical variable, if 'TRUE', only statistics are
          calculated and returned; if 'FALSE', false discovery rates
          (FDRs) for a set of delta('deltas') are calculated and
          returned.

 verbose: A logical variable, if 'TRUE', informative mesages are
          printed during the computation process.

  deltas: A vector of values for the threshold delta; see Tusher et al.

  s.step: A numeric variable specifying the size of the moving window
          acorss the gene-wise standard deviations for the selection of
          the fudge factor s_0.

alpha.step: A numeric variable specifying the increment of a percentile
          sequence between 0 and 1, from which the fudge factor will be
          chosen to minimize the coefficient of variation of
          statistics.  

 plot.it: A logical variable, if 'TRUE', a plot between the coefficient
          of variation and the percentile sequence will be made.

_D_e_t_a_i_l_s:

     The function returned by 'comp.SAM' calculates SAM statistics for
     each row of the microarray data matrix, with bindings for 'L',
     'prob', 'B', 'stat.only', 'verbose', 'deltas', 's.step',
     'alpha.step' and 'plot.it'. If 'quantile=NULL', the fudge factor
     s_0 is calculated as the percentile of the gene-wise standard
     deviations that minimizes the coefficient of variation of the
     statistics; otherwise s_0 is set as the specified percentile of
     standard deviations. If 'stat.only=T', only SAM statistics are
     returned; otherwise, permutation will be carried out to calculate
     the FDRs for a set of 'deltas' specified and a FDR table will be
     returned in addition to the SAM statistics.

_V_a_l_u_e:

     'SAM' returns a function (F) with bindings for a series of
     arguments. When 'stat.only=T', the function F when evaluated
     returns a numeric vector of SAM statistics; When 'stat.only=F',
     the function F when evaluated returns a list of the following
     components: 

geneOrder: Order of genes in terms of differential expression;

     sam: Sorted SAM statistics;

fdr.table: A matrix with columns: delta, no.significance, no.positive,
          no.negatvie, FDR(50%), FDR(90%).

_A_u_t_h_o_r(_s):

     Yuanyuan Xiao, yxiao@itsa.ucsf.edu, 
      Jean Yee Hwa Yang, jean@biostat.ucsf.edu.

_R_e_f_e_r_e_n_c_e_s:

     Tusher, V.G., Tibshirani, R., and Chu, G. (2001). Significance
     analysis of microarrays applied to the ionizing radiation
     response, _PNAS_, 98, 5116-5121.

_S_e_e _A_l_s_o:

     'comp.t'

_E_x_a_m_p_l_e_s:

     X <- matrix(rnorm(1000,0,0.5), nc=10)
     L <- rep(0:1,c(5,5))

     # genes 1-10 are differentially expressed
     X[1:10,6:10]<-X[1:10,6:10]+1

     # two sample test, statistics only
     sam.fun <- comp.SAM(L)
     sam.X <- sam.fun(X)

     # two sample test, FDR
     sam.fun <- comp.SAM(L, stat.only=FALSE, delta=c(0.1, 0.2, 0.5))
     sam.X <- sam.fun(X)

