twoGaussiansNull            package:Ringo            R Documentation

_E_s_t_i_m_a_t_e _a _t_h_r_e_s_h_o_l_d _f_r_o_m _G_a_u_s_s_i_a_n _m_i_x_t_u_r_e _d_i_s_t_r_i_b_u_t_i_o_n

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

     Function to estimate a threshold from Gaussian mixture
     distribution. The data is assumed to follow a mixture of two
     Gaussian distributions. The one Gaussian with the lower mean value
     is assumed to be the null distribution and probe levels are
     assigned p-values based on this null distribution. The threshold
     is then the minimal data value with an adjusted p-value smaller
     than a specified threshold.

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

     twoGaussiansNull(x, p.adj.method = "BY", max.adj.p = 0.1, var.equal = FALSE, ...)

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

       x: numeric vector of data values

p.adj.method: method for adjusting the p-values for multiple testing;
          must be one of 'p.adjust.methods'

max.adj.p: which adjusted p-value to use as upper limit for estimating
          the threshold

var.equal: logical; is the variance of the two Gaussians assumed to be
          equal or different

     ...: further arguments passed on to function 'Mclust'

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

     This function uses the package 'mclust' to fit a mixture of two
     Gaussians to the data. The threshold is then estimated from the
     fitted Gaussian with the lower mean value.

_V_a_l_u_e:

     Single numeric value. The threshold that is the minimal data value
     with an adjusted p-value smaller than a specified threshold.

_N_o_t_e:

     Thanks to Richard Bourgon for pointing out the necessity of
     providing this method as an alternative way of estimating the
     threshold.

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

     Joern Toedling, Aleksandra Pekowska

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

     'mclust', 'p.adjust'

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

       exDir <- system.file("exData",package="Ringo")
       load(file.path(exDir,"exampleProbeAnno.rda"))
       load(file.path(exDir,"exampleX.rda"))
       smoothX <- computeRunningMedians(exampleX, probeAnno=exProbeAnno,
          modColumn = "Cy5", allChr = "9", winHalfSize = 400)

       ## compare the two different ways of estimating the threshold
       y0a <- apply(exprs(smoothX), 2, upperBoundNull)
       y0b <- apply(exprs(smoothX), 2, twoGaussiansNull)

       hist(exprs(smoothX)[,1], n=10, main=NA,
            xlab="Smoothed expression level [log2]")
       abline(v=c(y0a, y0b), col=c("blue","orange"), lwd=2)
       legend(x="topright", col=c("blue","orange"), lwd=2, 
              legend=c(expression(paste(y[0]," Non-parametric")),
                       expression(paste(y[0]," Gaussian"))))

