heatmap.2: Colv dendrogram doesn't match size of x
1
0
Entering edit mode
@frederico-moraes-ferreira-5929
Last seen 6 months ago
Brazil
Hi List, I've got some problems doing a heatmap with following peace of code: library(gplots) row_distance = dist(dfdat_zscore, method =manhattan") row_cluster = hclust(row_distance, method = "ward.D") col_distance = dist(dfdat_zscore, method = "manhattan") col_cluster = hclust(col_distance, method = "ward.D") heatmap.2(as.matrix(dfdat_zscore), main = "Z-score", notecol="black", density.info="none", trace="none", margins =c(12,9), col=redgreen(75), breaks=col_breaks, dendrogram = "both", cexCol=0.5, cexRow=0.5, key=T, keysize=1.0, Rowv = as.dendrogram(row_cluster), Colv = as.dendrogram(col_cluster), distfun = dist(method = "manhattan"), hclustfun = hclust(col_distance, method = "ward.D"), labRow=rownames(df_zscore)) I've read some posts suggesting to upgrade gplots. However, the issue seems to persist with gplots_2.14.1 Any help is appreciated. Best. Additional information: > sessionInfo() R version 3.1.1 (2014-07-10) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] gplots_2.14.1 loaded via a namespace (and not attached): [1] KernSmooth_2.23-12 bitops_1.0-6 caTools_1.17 gdata_2.13.3 [5] gtools_3.4.1 [[alternative HTML version deleted]]
• 2.6k views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 4 months ago
United States
On Wed, Aug 27, 2014 at 7:06 PM, <ferreirafm at="" usp.br=""> wrote: > Hi List, > I've got some problems doing a heatmap with following peace of code: > > library(gplots) > row_distance = dist(dfdat_zscore, method =manhattan") > row_cluster = hclust(row_distance, method = "ward.D") > col_distance = dist(dfdat_zscore, method = "manhattan") > col_cluster = hclust(col_distance, method = "ward.D") > Assuming that dfdat_zscore is not a square matrix, row_distance should be using the transpose of that matrix. As it stands, you are calculating the distance between the columns for both col_distance and row_distance. Make that adjustment and see if that fixes your problem. Sean > > heatmap.2(as.matrix(dfdat_zscore), > main = "Z-score", > notecol="black", > density.info="none", > trace="none", > margins =c(12,9), > col=redgreen(75), > breaks=col_breaks, > dendrogram = "both", > cexCol=0.5, cexRow=0.5, > key=T, keysize=1.0, > Rowv = as.dendrogram(row_cluster), > Colv = as.dendrogram(col_cluster), > distfun = dist(method = "manhattan"), > hclustfun = hclust(col_distance, method = "ward.D"), > labRow=rownames(df_zscore)) > > I've read some posts suggesting to upgrade gplots. However, the issue > seems to persist with gplots_2.14.1 > Any help is appreciated. > Best. > > Additional information: > > sessionInfo() > R version 3.1.1 (2014-07-10) > Platform: x86_64-pc-linux-gnu (64-bit) > > locale: > [1] C > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] gplots_2.14.1 > > loaded via a namespace (and not attached): > [1] KernSmooth_2.23-12 bitops_1.0-6 caTools_1.17 gdata_2.13.3 > [5] gtools_3.4.1 > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at 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
0
Entering edit mode
Silly me. This is it! Thanks for helping ----- Mensagem original ----- De: "Sean Davis" <sdavis2 at="" mail.nih.gov=""> Para: ferreirafm at usp.br Cc: bioconductor at r-project.org Enviadas: Quarta-feira, 27 de Agosto de 2014 20:47:46 Assunto: Re: [BioC] heatmap.2: Colv dendrogram doesn't match size of x On Wed, Aug 27, 2014 at 7:06 PM, < ferreirafm at usp.br > wrote:
Hi List, I've got some problems doing a heatmap with following peace of code: library(gplots) row_distance = dist(dfdat_zscore, method =manhattan") row_cluster = hclust(row_distance, method = "ward.D") col_distance = dist(dfdat_zscore, method = "manhattan") col_cluster = hclust(col_distance, method = "ward.D") Assuming that dfdat_zscore is not a square matrix, row_distance should be using the transpose of that matrix. As it stands, you are calculating the distance between the columns for both col_distance and row_distance. Make that adjustment and see if that fixes your problem. Sean
heatmap.2(as.matrix(dfdat_zscore), main = "Z-score", notecol="black", density.info ="none", trace="none", margins =c(12,9), col=redgreen(75), breaks=col_breaks, dendrogram = "both", cexCol=0.5, cexRow=0.5, key=T, keysize=1.0, Rowv = as.dendrogram(row_cluster), Colv = as.dendrogram(col_cluster), distfun = dist(method = "manhattan"), hclustfun = hclust(col_distance, method = "ward.D"), labRow=rownames(df_zscore)) I've read some posts suggesting to upgrade gplots. However, the issue seems to persist with gplots_2.14.1 Any help is appreciated. Best. Additional information: > sessionInfo() R version 3.1.1 (2014-07-10) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] gplots_2.14.1 loaded via a namespace (and not attached): [1] KernSmooth_2.23-12 bitops_1.0-6 caTools_1.17 gdata_2.13.3 [5] gtools_3.4.1 [[alternative HTML version deleted]] _______________________________________________ Bioconductor mailing list Bioconductor at 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 REPLY

Login before adding your answer.

Traffic: 416 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