fdc                package:arrayMagic                R Documentation

_F_D_C (_f_a_l_s_e _d_i_s_c_o_v_e_r_y _c_o_u_n_t)

_D_e_s_c_r_i_p_t_i_o_n:

     Estimate the FDC (false discovery count) through permutations

_U_s_a_g_e:

     fdc(x, fac,
       teststatfun = "rowFtests",
       nrperm      = 100,
       nrgenesel   = c(10, 20, 40, 60, 80, 100, 200),
       ...)

_A_r_g_u_m_e_n_t_s:

       x: Matrix.

     fac: Factor, with 'length(fac)=ncol(x)'.

teststatfun: Character. Name of a function that takes arguments 'x' and
          'fac', and returns a list with component 'statistic'. See for
          example 'rowFtests'.

  nrperm: Numeric. Number of permutations.

nrgenesel: Numeric. A vector with the 'number of genes' for which the
          FDC is to be calculated.

     ...: Further arguments passed to code{teststatfun}.

_V_a_l_u_e:

     A list with elements 'stat': the test statistics; 'mpstat': median
     permuted test statistics; 'fdc': estimated false discovery counts;
     'thresh': the threshholds associated with 'nrgenesel'; 'nrgenesel'

_A_u_t_h_o_r(_s):

     Wolfgang Huber <w.huber@dkfz.de>

_S_e_e _A_l_s_o:

     'rowFtests'

_E_x_a_m_p_l_e_s:

        ## data matrix: 2000 genes, 16 samples
        x  <- matrix(runif(2000*16), ncol=16)
        ## 8 blue and 8 red samples
        fac <- factor(c(rep("blue", 8), rep("red", 8)))
        ## implant differential signal into the first 50 genes
        x[1:50, fac=="blue"] <- x[1:50, fac=="blue"] + 1

        res <- fdc(x, fac)
        plot(res$nrgenesel, res$fdc, pch=16, col="blue",
            xlab="Number of genes selected",
            ylab="Expected number of false discoveries")
        abline(a=0, b=1, col="red", lwd=2)

        qqplot(res$stat, res$mpstat, pch=".")
        abline(a=0, b=1, col="red", lwd=2)

