BGmix                 package:BGmix                 R Documentation

_F_i_t _t_h_e _B_G_m_i_x _d_i_f_f_e_r_e_n_t_i_a_l _e_x_p_r_e_s_s_i_o_n _m_o_d_e_l.

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

     This is the main function of the BGmix package. It calls the C++
     code which performs the MCMC to fit the BGmix model.

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

     BGmix(ybar, ss, nreps, neffects = 2, xx = matrix(c(1, 1, -0.5, 0.5),
     ncol = 2, byrow = T), ntau = NULL, indtau = NULL, jstar = 1, niter =
     10000, nburn = 10000, nthin = 10, seed = 12345, move.choice.bz = 4,
     move.choice.aa = 1, move.choice.lam = 0, move.choice.tau = 1,
     move.choice.eta = 1, trace.out = 1, trace.pred = 0, sig.aa = 0.1,
     tau.eps = 50, lambda.up.init=1.5, lambda.down.init=1.5,
     datafilename.ybar = NULL, xfilename = NULL, itfilename =
     NULL, rundir=".")

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

    ybar: matrix no. genes x no. experimental conditions. Mean log gene
          expression for each gene in each condition.

      ss: matrix no. genes x no. experimental conditions. Sample
          variance of log gene expression for each gene in each
          condition.

   nreps: vector containing the number of replicate arrays in each
          experimental condition

neffects: number of effect parameters per gene (eg. 2 for unpaired
          differential expression)

      xx: design matrix: no. effects x no. experimental conditions. See
          Vignette for specification of design matrix. Default is for
          unpaired differential expression.

    ntau: number of variances per gene 

  indtau: label for each condition indicating which variance grouping
          that condition belongs to. See Vignette for more detail. 

   jstar: Label of the effect parameter which has the mixture prior.
          Labels start at 0, as in C++. If no parameter has a mixture
          prior, set jstar=-1.

   niter: no. MCMC iterations after burn-in. This must be at least 100
          for the function to work (or else set to zero).

   nburn: no. MCMC iterations for burn-in. This must be at least 100
          for the function to work (or else set to zero).

   nthin: thinning parameter for MCMC iterations

    seed: initial value for random seed

move.choice.bz: indicates choice of mixture prior: 1 for point mass
          null + Uniform alternatives, 4 for point mass null + Gamma
          alternatives, 5 for small Normal null + Gamma alternatives

move.choice.aa: if this is 1, hyperparameter a for gene variances is
          updated, if this is 0 it is fixed. 

move.choice.lam: if this is 1, hyperparameter lambda for mixture prior
          is updated, if this is 0 it is fixed. 

move.choice.tau: indicates choice of prior on gene variances: 1 for
          Inverse Gamma, 2 for log Normal.

move.choice.eta: if this is 1, hyperparameter eta for mixture prior is
          updated, if this is 0 it is fixed. 

trace.out: if this is 1, output trace of model parameters, if this is
          0, no output.

trace.pred: if this is 1, output trace of predictive quantities, if
          this is 0, no output.

  sig.aa: step-size in random walk update for a (hyperparameter for
          gene variances distribution)

 tau.eps: Value of epsilon used in the small Normal null mixture
          component.

lambda.up.init: init or fixed value of lambda+ (parameter of Gamma
          mixture component)

lambda.down.init: init or fixed value of lambda- (parameter of Gamma
          mixture component)

datafilename.ybar: character. Name describing the data set (by default
          this is taken from the name of the ybar argument).

xfilename: character. Name describing the design matrix.

itfilename: character. Name describing the indtau parameter.

  rundir: character. Path for saving output files. A new sub-directory
          is created in the 'rundir' directory.

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

     The C++ code writes a count down on the screen, to give an
     indication of how long the code has to run. Output is written to a
     sub-directory of the working directory. This sub-directory is
     created automatically, and its name is printed by the C++ code to
     the screen.

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

     The output directory is returned (character).

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

     Alex Lewin

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

     Lewin, A., Bochkina, N. and Richardson, S. (2007), Fully Bayesian
     mixture model for differential gene expression: simulations and
     model checks. <URL: http://www.bgx.org.uk/publications.html>

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

     ## Note this is a very short MCMC run!
     ## For good analysis need proper burn-in period.
     data(ybar,ss)
     BGmix(ybar, ss, c(8,8), nburn=0, niter=1000, nthin=1)

