classpred                package:gaga                R Documentation

_P_r_e_d_i_c_t _t_h_e _c_l_a_s_s _t_h_a_t _a _n_e_w _s_a_m_p_l_e _b_e_l_o_n_g_s _t_o.

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

     Computes the posterior probability that a new sample belongs to
     each group and classifies it into the group with highest
     probability.

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

     classpred(gg.fit, xnew, x, groups, prgroups, ngene=100)

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

  gg.fit: GaGa or MiGaGa fit (object of type 'gagafit', as returned by
          'fitGG'). 

    xnew: Expression levels of the sample to be classified. Only the
          subset of the genes indicated by ngene is used.

       x: 'ExpressionSet', 'exprSet', data frame or matrix containing
          the gene expression measurements used to fit the model.

  groups: If 'x' is of type 'ExpressionSet' or 'exprSet', 'groups'
          should be the name of the column in 'pData(x)' with the
          groups that one wishes to compare. If 'x' is a matrix or a
          data frame, 'groups' should be a vector indicating to which
          group each column in x corresponds to.

prgroups: Vector specifying prior probabilities for each group.
          Defaults to equally probable groups.

   ngene: Number of genes to use to build the classifier. Genes with
          smaller probability of being equally expressed are selected
          first.

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

     The classifier weights each gene according to the posterior
     probability that it is differentially expressed. Hence, adding
     genes that are unlikely to be differentially expressed does not
     affect the performance of the classifier, but it does increase the
     computational cost. All computations are performed by fixing the
     hyper-parameters to their estimated value (posterior mean if model
     was fit with 'method=='Bayes'' or maximum likelihood estimate is
     model was fit with 'method=='EBayes'').

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

     List with the following elements: 

      d : Numeric value indicating the group that the new sample is
          classified into, i.e. where the maximum in 'posgroups' is.

posgroups : Vector giving the posterior probability that the 'xnew'
          belongs to each of the groups.

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

     David Rossell

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

     Rossell D. GaGa: a simple and  flexible hierarchical model for
     microarray data analysis. <URL:
     http://rosselldavid.googlepages.com>.

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

     'fitGG', 'parest'

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

     #Not run. Example from the help manual
     #library(gaga)
     #set.seed(10)
     #n <- 100; m <- c(6,6)
     #a0 <- 25.5; nu <- 0.109
     #balpha <- 1.183; nualpha <- 1683
     #probpat <- c(.95,.05)
     #xsim <- simGG(n,m,p.de=probpat[2],a0,nu,balpha,nualpha)
     #
     #ggfit <- fitGG(xsim$x[,c(-6,-12)],groups,patterns=patterns,nclust=1)
     #ggfit <- parest(ggfit,x=xsim$x[,c(-6,-12)],groups,burnin=100,alpha=.05)
     #
     #pred1 <- classpred(ggfit,xnew=xsim$x[,6],x=xsim$x[,c(-6,-12)],groups)
     #pred2 <- classpred(ggfit,xnew=xsim$x[,12],x=xsim$x[,c(-6,-12)],groups)
     #pred1
     #pred2

