小编Mig*_*dez的帖子

使用 R 反转树状图中的叶子顺序

我已经尝试了几天来翻转树状图,以便最后一个基因是图中的第一个,第一个是最后一个。但即使我设法移动叶子,内部排序也不一样。这是我的脚本:

cluster.hosts <- read.table("Norm_0_to1_heatmap.txt", header = TRUE, sep="", quote="/", row.names = 1)
# A table with 8 columnns and 229 rows cirresponding to gene expression 
 hosts.dist <- dist(cluster.hosts, method = "euclidean", diag = FALSE, upper = FALSE, p = 2)
 hc <- hclust(hosts.dist, method = "average")
 dd <- as.dendrogram(hc)
 order.dendrogram(dd)

X11()
par(cex=0.5,font=3)
plot(dd, main="Dendrogram of Syn9 genes")
order.dd <- order.dendrogram(dd)    #the numbers in the order indicate the position of the gene in the original table
#Then I generate a vector …
Run Code Online (Sandbox Code Playgroud)

r dendrogram hclust

2
推荐指数
1
解决办法
3261
查看次数

标签 统计

dendrogram ×1

hclust ×1

r ×1