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
.
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")
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
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.d.genes
. Only needed if genes are clustered (hopach.genes!=NULL).d.arrays
. Only needed if arrays are clustered (hopach.arrays!=NULL).distancematrix()
and distancevector()
.data
.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.
hopach2tree
should be run on the same OS as MapleTree whenever possible.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.
http://www.stat.berkeley.edu/~laan/Research/Research_subpages/Papers/hopach.pdf
hopach
, boothopach
, bootmedoids
, boot2fuzzy
#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)
Run the code above in your browser using DataLab