plotHistDensity        package:GeneSelectMMD        R Documentation

_P_l_o_t _o_f _h_i_s_t_o_g_r_a_m _a_n_d _d_e_n_s_i_t_y _e_s_t_i_m_a_t_e _o_f _t_h_e _p_o_o_l_e_d _g_e_n_e _e_x_p_r_e_s_s_i_o_n _l_e_v_e_l_s.

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

     Plot of histogram of pooled gene expression levels, composited
     with density estimate based on the mixture of marginal
     distributions. The density estimate is based on the assumption
     that the marginal correlations between subjects are zero.

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

     plotHistDensity(obj.gsMMD,
                     plotFlag="case",
                     plotComponent=FALSE,
                     myxlab="expression level",
                     myylab="density",
                     mytitle="Histogram of gene expression levels\nimposed with estimated density (case)",
                     x.legend=NULL,
                     y.legend=NULL,
                     numPoints=500,
                     mycol=1:4, 
                     mylty=1:4, 
                     mylwd=rep(3,4), 
                     cex.main=2, 
                     cex.lab=1.5, 
                     cex.axis=1.5, 
                     cex=2,
                     bty="n")

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

obj.gsMMD: an object returned by 'gsMMD', 'gsMMD.default', 'gsMMD2', or
          'gsMMD2.default' 

plotFlag: logical. Indicate the plot will based on which type of
          subjects.

plotComponent: logical. Indicate if components of the mixture of
          marginal distribution will be plotted.

  myxlab: label for x-axis

  myylab: label for y-axis

 mytitle: title of the plot

x.legend: the x-corrdiates of the legend

y.legend: the y-corrdiates of the legend

numPoints: logical. Indicate how many genes will be plots.

   mycol: color for the density estimates (overall and components)

   mylty: line styles for the density estimates (overall and
          components)

   mylwd: line width for the density estimates (overall and components)

cex.main: font for main title

 cex.lab: font for x- and y-axis labels

cex.axis: font for x- and y-axis

     cex: font for texts

     bty: the type of box to be drawn around the legend.  The allowed
          values are '"o"' and '"n"' (the default).

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

     For a given type of subjects, we pool their expression levels
     together if the marginal correlations among subjects are zero. We
     then draw a histogram of the pooled expression levels. Next, we
     composite density estimates of gene expression levels for the
     overal distribution and the 3 component distributions.

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

     A list containing coordinates of the density estimates: 

      x : sorted pooled gene expression levels for cases or controls.

     x2 : a subset of 'x' specified by the sequence:
          'seq(from=1,to=len.x, by=delta)', where 'len.x' is the length
          of the vector 'x', and 'delta=floor(len.x/numpoints).'

      y : density estimate corresponding to 'x2'

     y1 : weighted density estimate for gene cluster 1

     y2 : weighted density estimate for gene cluster 2

     y3 : weighted density estimate for gene cluster 3

_N_o_t_e:

     The density estimate is obtained based on the assumption that the
     marginal correlation among subjects is zero. If the estimated
     marginal correlation obtained by 'gsMMD' is far from zero, then do
     not use this plot function.

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

     Weiliang Qiu stwxq@channing.harvard.edu, Wenqing He
     whe@stats.uwo.ca, Xiaogang Wang stevenw@mathstat.yorku.ca, Ross
     Lazarus ross.lazarus@channing.harvard.edu

_R_e_f_e_r_e_n_c_e_s:

     Qiu, W.-L., He, W., Wang, X.-G. and Lazarus, R. (2008).  A
     Marginal Mixture Model for Selecting Differentially Expressed
     Genes across Two Types of Tissue Samples. _The International
     Journal of Biostatistics. 4(1):Article 20._ <URL:
     http://www.bepress.com/ijb/vol4/iss1/20>

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

       library(ALL)
       data(ALL)
       eSet1 <- ALL[1:100, ALL$BT == "B3" | ALL$BT == "T2"]
       
       mem.str <- as.character(eSet1$BT)
       nSubjects <- length(mem.str)
       memSubjects <- rep(0,nSubjects)
       # B3 coded as 0 (control), T2 coded as 1 (case)
       memSubjects[mem.str == "T2"] <- 1
       
       obj.gsMMD <- gsMMD(eSet1, memSubjects, transformFlag = TRUE, 
         transformMethod = "boxcox", scaleFlag = TRUE, quiet = FALSE)

       plotHistDensity(obj.gsMMD, plotFlag = "case", 
           mytitle = "Histogram of gene expression levels for T2\nimposed with estimated density (case)", 
           plotComponent = TRUE, 
           x.legend = c(0.8, 3), 
           y.legend = c(0.3, 0.4), 
           numPoints = 500)

