简体   繁体   English

R:哪个热图/图像在没有任何树状图的情况下得到行排序图?

[英]R: Which heatmap/image to get row-sorted plot without any dendrogram?

Which package is best for a heatmap/image with sorting on rows only, but don't show any dendrogram or other visual clutter (just a 2D colored grid with automatic named labels on both axes) . 哪个包最适合热图/图像,仅在行上排序,但不显示任何树形图或其他视觉混乱(只是在两个轴上都带有自动命名标签的2D彩色网格) I don't need fancy clustering beyond basic numeric sorting. 除了基本的数字排序之外,我不需要花哨的聚类。 The data is a 39x10 table of numerics in the range (0,0.21) which I want to visualize. 数据是一个39x10的数值表,范围(0,0.21)我想要可视化。

I searched SO (see this ) and the R sites, and tried a few out. 我搜索了SO(见这个 )和R网站,并尝试了一些。 Check out R Graphical Manual to see an excellent searchable list of screenshots and corresponding packages. 查看R图形手册 ,查看优秀的可搜索的屏幕截图列表和相应的软件包。

The range of packages is confusing - which one is the preferred heatmap (like ggplot2 is for most other plotting)? 包的范围令人困惑 - 哪一个是首选的热图(如ggplot2适用于大多数其他绘图)? Here is what I found out so far: 这是我到目前为止发现的:

base::heatmap is annoying, even with args heatmap(..., Colv=NA, keep.dendro=FALSE) it still plots the unwanted dendrogram on rows. base::heatmap很烦人,即使使用args heatmap(..., Colv=NA, keep.dendro=FALSE)它仍会在行上绘制不需要的树形图。

For now I'm going with pheatmap(..., cluster_cols=FALSE, cluster_rows=FALSE) and manually presorting my table, like this guy: Order of rows in heatmap? 现在我要使用pheatmap(..., cluster_cols=FALSE, cluster_rows=FALSE)并手动预先分配我的表,就像这个人: 热图中的行顺序?

Addendum: to display the value inside each cell, see: display a matrix, including the values, as a heatmap . 附录:要显示每个单元格内的值,请参阅: 显示矩阵(包括值)作为热图 I didn't need that but it's nice-to-have. 我不需要那个,但它很棒。

使用pheatmap您可以使用选项treeheight_rowtreeheight_col并将它们设置为0。

just another option you have not mentioned...package bipartite as it is as simple as you say 只是你没有提到的另一种选择...包bipartite因为它就像你说的那么简单

library(bipartite)
mat<-matrix(c(1,2,3,1,2,3,1,2,3),byrow=TRUE,nrow=3)
rownames(mat)<-c("a","b","c")
colnames(mat)<-c("a","b","c")
visweb(mat,type="nested")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM