【发布时间】:2021-08-02 05:10:08
【问题描述】:
您好,我的目标是制作物种丰度的热图,并同时显示系统发育树。系统发育树在 MEGA 中制作,并在转换为树状图对象之前作为 Newick 文件输入到 R。
但是,输出图中系统发育树的分支长度并不相同。请问有什么办法可以让分支长度相似吗?
我附上了下面的代码和输出。提前谢谢你。
library(DECIPHER)
library(dendextend)
library(ape)
#Input the tree from newick file from Mega and convert into dendrogram
dend <- ReadDendrogram("VPstrainand3-major_ASV_5%_withlength.nwk")
#Make the plot using data from the excel stored in the directory
#load the data
library(openxlsx)
library(dplyr)
heatmap.dataframe <- read.xlsx("Complete.xlsx","Modified", rowNames =TRUE)
heatmap.mat <- as.matrix(heatmap.dataframe)
whitered <- colorRampPalette(c("white", "red"), space = "rgb")(100)
#plot
library(repr)
options (repr.plot.width=20, repr.plot.height=20)
heatmap <- heatmap(as.matrix(heatmap.mat), Rowv = dend, Colv = NA, col = whitered)
print(heatmap)
【问题讨论】:
-
这和git有什么关系? (我认为您可能已经接受了基于“分支”一词的机器建议,但 Git 的分支与系统发育分支无关。请检查并更正您的标签。)
标签: r