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' in package genefilter.

  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

        library(genefilter)
        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)

