consensus              package:maanova              R Documentation

_B_u_i_l_d _c_o_n_s_e_n_s_u_s _t_r_e_e _o_u_t _o_f _b_o_o_t_s_t_r_a_p _c_l_u_s_t_e_r _r_e_s_u_l_t

_D_e_s_c_r_i_p_t_i_o_n:

     This is the function to build the consensus tree from the
     bootstrap clustering analysis. If the clustering algorithm is
     hierarchical clustering, the majority rule consensus tree will be
     built based on the given significance level. If the clustering
     algorithm is K-means, a consensus K-means group will be built.

_U_s_a_g_e:

     consensus(macluster, level = 0.8, draw=TRUE)

_A_r_g_u_m_e_n_t_s:

macluster: An object of class 'macluster', which is the output of
          'macluster'

   level: The significance level for the consensus tree. This is a
          numeric number between 0.5 and 1.

    draw: A logical value to indicate whether to draw the consensus
          tree on screen or not.

_V_a_l_u_e:

     An object of class 'consensus.hc' or 'consensus.kmean' according
     to the clustering method.

_A_u_t_h_o_r(_s):

     Hao Wu

_S_e_e _A_l_s_o:

     'macluster'

_E_x_a_m_p_l_e_s:

     # load data
     data(abf1)
     ## Not run: 
     # fit the anova model
     fit.fix = fitmaanova(abf1,formula = ~Strain)
     # test Strain effect 
     test.fix = matest(abf1, fit.fix, term="Strain",n.perm= 1000)
     # pick significant genes - pick the genes selected by Fs test
     idx <- volcano(test.fix)$idx.Fs
     # do k-means cluster on genes
     gene.cluster <- macluster(fit.fix, term="Strain", idx, what="gene", 
        method="kmean", kmean.ngroups=5, n.perm=100)
     # get the consensus group
     genegroup = consensus(gene.cluster, 0.5)
     # get the gene names belonging to each group
     genegroupname = genegroup$groupname

     # HC cluster on samples
     sample.cluster <- macluster(fit.fix, term="Strain", idx, what="sample",method="hc")
     # get the consensus group
     consensus(sample.cluster, 0.5)
     ## End(Not run)

