OCshow                package:OCplus                R Documentation

_S_h_o_w _o_n_e _o_r_e _s_e_v_e_r_a_l _O_C _c_u_r_v_e_s _g_r_a_p_h_i_c_a_l_l_y

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

     Plots empirical OC curves for one or several data sets
     simultaneously, showing the local or global false discovery rate
     among the top regulated genes. This is the preferred way of
     comparing the OC of different analyses.

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

     OCshow(x, ..., global = TRUE, percentage = TRUE, top = 0.1, legend, lty, col, main, xlab, ylab)

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

  x, ...: one or several objects created by either 'EOC', 'fdr1d', or
          'fdr2d'

  global: logical value indicating whether to show the global or the
          local false discovery rates; note that if any of the objects
          to be plotted was created by 'EOC', only global Fdr is
          available.

percentage: logical switch indicating whether to show the percentage of
          top regulated genes or the actual numbers; note that the
          cutoff 'top' is always a percentage

     top: a value between 0 and 1 specifying the percentage of
          top-regulated genes that is to be shown in the plot

  legend: a character vector giving names for each of the objects to be
          plotted for a legend in the left upper corner

lty, col: line styles and colors for the different OC curves

    main: a plot title

xlab, ylab: axis labels

_D_e_t_a_i_l_s:

     Each object generated by 'EOC', 'fdr1d', and 'fdr2d' lists for
     each gene a t-statistic and either a local or a global false
     discovery rate. The OC curves are constrcuted by ordering the
     genes according to the false discovery rates, and counting how
     many fall under a given threshold. These counts are plotted
     (either directly or as percentage of all genes) on the horzontal
     axis, while the thresholds are plotted on the vertical axis. Where
     appropriate, local false discovery rates are converted to global
     rates by simple averaging.

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

     A. Ploner

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

     'EOC', 'fdr1d', 'fdr2d'

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

     # We simulate a small example with 5 percent regulated genes and
     # a rather large effect size
     set.seed(2003)
     xdat = matrix(rnorm(50000), nrow=1000)
     xdat[1:25, 1:25] = xdat[1:25, 1:25] - 2
     xdat[26:50, 1:25] = xdat[26:50, 1:25] + 2
     grp = rep(c("Sample A","Sample B"), c(25,25))

     # Compute the different false discovery rates
     # p0 is fixed
     global = EOC(xdat, grp, plot=FALSE, p0=0.95)
     local1d = fdr1d(xdat, grp, p0=0.95)
     local2d = fdr2d(xdat, grp, p0=0.95)

     # Some possible arrangements
     leg = c("global","local1d","local2d")
     par(mfrow=c(2,2))
     OCshow(global, local1d, local2d, legend=leg, main="Default")
     OCshow(global, local1d, local2d, legend=leg, percentage=FALSE, 
            main="Number of genes")
     OCshow(global, local1d, local2d, legend=leg, top=1, main="All genes")
     OCshow(local1d, local2d, legend=leg[2:3], global=FALSE, main="Local fdr")

