Search
Question: heatmap questions
0
gravatar for Wang, Li
5.0 years ago by
Wang, Li170
Wang, Li170 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
ADD COMMENTlink modified 5.0 years ago by TriS200 • written 5.0 years ago by Wang, Li170
0
gravatar for TriS
5.0 years ago by
TriS200
United States
TriS200 wrote:
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 COMMENTlink written 5.0 years ago by TriS200
Please log in to add an answer.

Help
Access

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