hopach2tree              package:hopach              R Documentation

_f_u_n_c_t_i_o_n _t_o _w_r_i_t_e _M_a_p_l_e_T_r_e_e _f_i_l_e_s _f_o_r _v_i_e_w_i_n_g _h_o_p_a_c_h _h_i_e_r_a_r_c_h_i_c_a_l _c_l_u_s_t_e_r_i_n_g _r_e_s_u_l_t_s

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

     The MapleTree software (http://mapletree.sourceforge.net/) is an
     open source, cross-platform, visualization tool to graphically
     browse results of cluster analyses. The 'hopach2tree' function
     takes a data matrix, plus corresponding 'hopach' clustering output
     for genes and/or arrays, and writes the (.cdt, .gtr, and .atr)
     files needed to view these hierarchical clustering results in
     MapleTree. The function 'makeTree' is called internally by
     'hopach2tree'.

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

     hopach2tree(data, file = "HOPACH", hopach.genes = NULL, hopach.arrays = NULL, 
     dist.genes = NULL, dist.arrays = NULL, d.genes = "cosangle", 
     d.arrays = "euclid", gene.wts = NULL, array.wts = NULL, gene.names = NULL)

     makeTree(labels, ord, medoids, dist, side = "GENE")

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

    data: data matrix, data frame or 'ExpressionSet' of gene expression
          measurements. Each column corresponds to an array, and each
          row corresponds to a gene. All values must be numeric.
          Missing values are ignored.

    file: name for the output files (the extensions .cdt, .gtr and .atr
          will be added).

hopach.genes: output of the 'hopach' function applied to genes (rows of
          'data'. If only arrays are clustered, hopach.genes can be
          NULL. There must be at least K=2 levels in the hopach final
          tree (ie: hopach.genes$final$labels greater than 1 digit) for
          a gtr file to be generated.

hopach.arrays: optional output of the 'hopach' function applied to
          arrays (columns of 'data'. There must be at least K=2 levels
          in the hopach final tree (ie: hopach.arrays$final$labels
          greater than 1 digit) for an atr file to be generated.

dist.genes: matrix of pair wise distances between all genes. All values
          must be numeric, and missing values are not allowed. If NULL,
          this matrix is computed using the metric specified by
          'd.genes'. Only needed if genes are clustered
          (hopach.genes!=NULL).

dist.arrays: matrix of pair wise distances between all arrays. All
          values must be numeric, and missing values are not allowed.
          If NULL, this matrix is computed using the metric specified
          by 'd.arrays'. Only needed if arrays are clustered
          (hopach.arrays!=NULL).

 d.genes: character string specifying the metric to be used for
          calculating dissimilarities between genes. The currently
          available options are "cosangle" (cosine angle or uncentered
          correlation distance), "abscosangle" (absolute cosine angle
          or absolute uncentered correlation distance), "euclid"
          (Euclidean distance), "abseuclid" (absolute Euclidean
          distance), "cor" (correlation distance), and "abscor"
          (absolute correlation distance). Advanced users can write
          their own distance functions and add these to the functions
          'distancematrix()' and 'distancevector()'.

d.arrays: character string specifying the metric to be used for
          calculating dissimilarities between arrays.

gene.wts: an optional vector of numeric weights for the genes.

array.wts: an optional vector of numeric weights for the arrays.

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

  labels: final cluster labels from a hopach object.

     ord: final ordering from a hopach object.

 medoids: final medoids matrix from a hopach object.

    dist: gene or array distance matrix.

    side: character string specifying if the tree is for genes ("GENE",
          default) or arrays ("ARRY").

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

     The function 'hopach2tree' has no value. It writes up to three
     text files to the current working directory. A .cdt file is always
     produced. This file can be used to visualize the data matrix as a
     heat map in MapleTree or other viewers such as TreeView
     (http://rana.lbl.gov/EisenSoftware.htm), jtreeview
     (http://sourceforge.net/projects/jtreeview/), and GeneXPress
     (http://genexpress.stanford.edu/). When 'hopach.genes'!=NULL, a
     .gtr is produced, and gene clustering results can be viewed,
     including ordering the genes in the heat map according to the
     final level of the 'hopach' tree and drawing the dendogram for
     hierarchical gene clustering. Similarly, when
     'hopach.arrays'!=NULL, an .atr file is produced and array
     clustering results can be viewed.

     The function 'makeTree' is called internally by 'hopach2tree' to
     make the objects needed to write the MapleTree files for a gene
     and/or array HOAPCH clustering result.

_W_a_r_n_i_n_g:

     Operating systems use different end of line characters. These
     characters can cause errors in MapleTree when files generated on
     one OS are visualized on another OS. Hence, 'hopach2tree' should
     be run on the same OS as MapleTree whenever possible.

_N_o_t_e:

     Thank you to Lisa Simirenko <lsimirenko@lbl.gov> for providing
     HOPACH views in MapleTree, and to Karen Vranizan
     <vranizan@uclink.berkeley.edu> for her input. 

     The MapleTree software can be downloaded from:
     http://sourceforge.net/projects/mapletree/

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

     Katherine S. Pollard <kpollard@soe.ucsc.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', 'boot2fuzzy'

_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)

     #write MapleTree files
     hopach2tree(mydata,hopach.genes=clustresult,dist.genes=mydist)

