Entering edit mode
Alyaa Mahmoud
▴
440
@alyaa-mahmoud-4670
Last seen 4.7 years ago
Dear all
I use heatmap.2 to generate a heatmap, but the generated pdf seems
very
cloudy !!! I use the following lines of code,
can anyone help allocate where the problem is ??
# generate heatmap for matrix bb
hc <- hclust(as.dist(1-cor(as.matrix(bb), method="spearman")),
method="complete", members=NULL)
# Clusters columns by Spearman correlation as distance method.
hr <- hclust(as.dist(1-cor(t(as.matrix(bb)), method="spearman")),
method="complete", members=NULL)
mycl <- cutree(hr, h=max(hr$height)/1.5);
mycolhc <- rainbow(length(unique(mycl)), start=0.1, end=0.9);
mycolhc <- mycolhc[as.vector(mycl)] # Cuts the tree and creates color
vector for clusters.
library(gplots);
myheatcol <- redgreen(75)
pdf("heatmap_dataset1.pdf")
heatmap.2(bb, Rowv=as.dendrogram(hr), Colv=as.dendrogram(hc),
col=myheatcol, scale="row", density.info="none", trace="none",
RowSideColors=mycolhc)
dev.off()
Thanks a lot
yours,
Alyaa
--
Alyaa Mahmoud
"Love all, trust a few, do wrong to none"- Shakespeare
[[alternative HTML version deleted]]