makeoutput              package:hopach              R Documentation

_f_u_n_c_t_i_o_n _t_o _w_r_i_t_e _a _t_e_x_t _f_i_l_e _w_i_t_h _h_o_p_a_c_h _o_u_t_p_u_t

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

     The function 'makeoutput' takes a data matrix and corresponding
     'hopach' clustering output, plus possibly bootstrap resampling
     output, and makes a table summarizing the clustering results. The
     table is written to a tab delimited text file.

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

     makeoutput(data, hopachobj, bootobj = NULL, file = "HOPACH.out", 
     gene.names = NULL)

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

    data: data matrix, data frame or exprSet of gene expression
          measurements. Typically, each column corresponds to an array,
          and each row corresponds to a gene. For clustering arrays,
          the arrays appear in the rows and the genes in the columns.
          All values must be numeric. Missing values are ignored.

hopachobj: output of the 'hopach' function.

 bootobj: optional output of 'boothopach' or 'bootmedoids' - a matrix
          of bootstrap estimated cluster membership probabilities, with
          a row for each row in 'data' and a column for each cluster.

    file: filename for the table produced.

gene.names: optional names or annotations for the genes (arrays), which
          can be different from the row names of 'data'

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

     The output table contains information about the rows of 'data':
     Index, UID and Name; the main cluster results: Cluster Number,
     Cluster Label (from 'hopach'), and Cluster Level Order (the
     ordering of the elements in the level of the 'hopach' tree at
     which the main clusters were identified); and the final level of
     the tree: Final Label, and Final Order (the ordering of elements
     in the final level of the tree). Sorting this table on Index
     results in the rows having the same order as in data. Sorting on
     Cluster Level Order results in the rows being ordered by cluster,
     and then within cluster based on the value of the argument 'ord'
     to 'hopach' (default is distance to the medoid). Sorting on Final
     Level Order results in the rows being ordered as in the leaves of
     the 'hopach' tree, where clusters are still ordered and elements
     near each other in the ordering will have small pairwise
     distances.

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

     The function 'makeoutput' has no value. It writes a tab delimited
     text file to the current working directory.

_N_o_t_e:

     Thank you to Karen Vranizan <vranizan@uclink.berkeley.edu> for
     helping to write this function.

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

     Katherine S. Pollard <kpollard@gladstone.ucsf.edu>

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

     van der Laan, M.J. and Pollard, K.S. A new algorithm for hybrid
     hierarchical clustering with visualization and the bootstrap.
     Journal of Statistical Planning and Inference, 2003, 117, pp.
     275-303.

     <URL:
     http://www.stat.berkeley.edu/~laan/Research/Research_subpages/Papers/hopach.pdf>

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

     'hopach', 'boothopach', 'bootmedoids'

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

     #25 variables from two groups with 3 observations per variable
     mydata<-rbind(cbind(rnorm(10,0,0.5),rnorm(10,0,0.5),rnorm(10,0,0.5)),cbind(rnorm(15,5,0.5),rnorm(15,5,0.5),rnorm(15,5,0.5)))
     dimnames(mydata)<-list(paste("Var",1:25,sep=""),paste("Exp",1:3,sep=""))
     mydist<-distancematrix(mydata,d="cosangle") #compute the distance matrix.

     #clusters and final tree
     clustresult<-hopach(mydata,dmat=mydist)

     #bootstrap resampling
     myobj<-boothopach(mydata,clustresult)

     #write output file
     makeoutput(mydata,clustresult,myobj)

