Question: Heatmaps in BHC package
gravatar for b.curran
4.8 years ago by
New Zealand
b.curran0 wrote:

Quick, probably simple question that I can't find the answer to. 


I'm using the BHC package. The paper associated with the package says that in addition to displaying the results as a dendrogram, it is possible to display the resulats as a heatmap using the package R heatmap command. It doesn't (that I can see), say how. Any attempt to put the dendrogram straight into heatmap, very rightly returns an error suggesting that x should be a  numeric matrix. And if you search for information on dendrograms and heatmaps all the results are dominated by how to attach dendrograms to the side of your heatmap rather than generate one from a dendrogram. Which would be odd anyway, so I believe I am missing something somewhere in the bhc package. Anyone know what I'm doing? 

In this case, candidates is a list of gene names that I am extracting from a larger frame of all genes.  Plotting the dendrogram works fine. 

rawCounts = read.table( datafile,sep=",", header=TRUE,row.names=1 , stringsAsFactors = FALSE )

timePoints <- 1:2 # for the time-course case

hc2 <- bhc(counts, candidates, 0, timePoints, "time-course", numReps=1, noiseMode=0, numThreads=10, verbose=TRUE)



Error in heatmap(hc2) : 'x' must be a numeric matrix




bhc • 657 views
ADD COMMENTlink modified 4.5 years ago by Rich Savage60 • written 4.8 years ago by b.curran0
Answer: Heatmaps in BHC package
gravatar for Rich Savage
4.5 years ago by
Rich Savage60
University of Warwick, UK
Rich Savage60 wrote:

Try something like the following:

hc3 <- bhc(discreteData, rowLabels, verbose = T)

hc2 <- bhc(t(discreteData), colLabels, verbose = T)

heatmap.2(discreteData, trace="none", hclustfun = function(x) hclust(x,"ave"),col=redgreen(100),breaks=colors,Rowv = hc2,Colv=hc3)

ADD COMMENTlink written 4.5 years ago by Rich Savage60
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 221 users visited in the last hour