heatmap questions
1
0
Entering edit mode
Wang, Li ▴ 180
@wang-li-5216
Last seen 10.2 years ago
Dear List members I used the following command to generate heatmap of expression value of differentially expressed genes. library("RColorBrewer") d <- read.delim("DE4018.txt", header=TRUE) x <- as.matrix(d) X_scaled <- t(apply(x, 1, scale)) hr <- hclust(as.dist(1-cor(t(X_scaled), method="spearman")), method="complete") hc <- hclust(as.dist(1-cor(X_scaled, method="spearman")), method="complete") hmcol<-brewer.pal(11,"RdBu") pdf(file = "heatmap20120517_4.pdf", height = 14, width = 7) heatmap(X_scaled, Rowv=as.dendrogram(hr), Colv=as.dendrogram(hc), col=hmcol, scale="row") dev.off() The generated map can not satisfy me fully. Because with using the dendrogram, samples of the same condition do not cluster together. In other words, samples from two conditions mixed up. My intention is to get the replicates from one condition cluster together. Could anyone please help me modify this code? Best regards Li
• 1.1k views
ADD COMMENT
0
Entering edit mode
TriS ▴ 200
@tris-5635
Last seen 4.3 years ago
United States
that depends a lot from your data, you can't "force" samples to go together (or at least you shouldn't) check your original data to see whether they go together if you use apply dimensionality reduction analysis (i.e. PCA) also, try different clustering methods, they will probably all lead to different results. Seb On Fri, Nov 30, 2012 at 3:57 PM, Wang, Li <li.wang@ttu.edu> wrote: > Dear List members > > I used the following command to generate heatmap of expression value of > differentially expressed genes. > > library("RColorBrewer") > > d <- read.delim("DE4018.txt", header=TRUE) > x <- as.matrix(d) > X_scaled <- t(apply(x, 1, scale)) > hr <- hclust(as.dist(1-cor(t(X_scaled), method="spearman")), > method="complete") > hc <- hclust(as.dist(1-cor(X_scaled, method="spearman")), > method="complete") > hmcol<-brewer.pal(11,"RdBu") > pdf(file = "heatmap20120517_4.pdf", height = 14, width = 7) > heatmap(X_scaled, Rowv=as.dendrogram(hr), Colv=as.dendrogram(hc), > col=hmcol, scale="row") > dev.off() > > The generated map can not satisfy me fully. Because with using the > dendrogram, samples of the same condition do not cluster together. In other > words, samples from two conditions mixed up. My intention is to get the > replicates from one condition cluster together. Could anyone please help me > modify this code? > > Best regards > Li > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

Traffic: 482 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6