首页 > 解决方案 > 如何使用 R 包:dendextend 使树清晰显示

问题描述

我对 R 包有疑问:dendextend,我想清楚地表明这一点。我试图增加树的大小,但是叶子的长度增加了,节点仍然重叠。你知道什么选项可以在叶子的长度不太长的情况下使节点清晰显示吗? 在此处输入图像描述 在此处输入图像描述

t1 = read.dendrogram("F:/Neighbor-joining-tree.newick")
t1 = dendrapply(t1, function(x) {
 if(is.leaf(x)) {
    attr(x, "height") = 0
  }
 x
})
hist_minor <- Heatmap(minor,
                  column_title = "Statistics for a list of SNP.Frequency.minor",
                  column_title_gp = gpar(fontsize = 15, fontface = "bold"),
                  column_names_gp = gpar(fontsize = 10),
                  row_title = "Genome Postion(bp)",
                  row_title_gp = gpar(fontsize = 10),
                  name = "Variant.Frequency", 
                  cluster_rows = FALSE,
                  cluster_columns = t1,
                  use_raster = TRUE,
                  raster_resize_mat = max,
                  right_annotation = ha,
                  show_row_names = FALSE,
                  col = cols,
                  column_dend_height= unit(3, "cm"),
                  #column_dend_height= unit(6, "cm")
                  border_gp = gpar(col = "black", lty = 2)
)

标签: r

解决方案


推荐阅读