ComplexHeatmap学习笔记

set.seed(12345)
cls <- plyr::ldply (row_order(p), data.frame)
names(cls) <- c("id", "rowid") 
cls <- dplyr::arrange(cls, rowid)
scaled_cluster_data2$cluster <- cls$id

特别注意,使用row_order提取聚类结果时,如果不set.seed,那聚类结果会不一致,为了提取的聚类结果与作图的结果一致,要set.seed

 

Referrence:

https://www.bioinfo-scrounger.com/archives/484/

https://stackoverflow.com/questions/50829127/inconsistent-clustering-with-complexheatmap

 Inspired by Nancy's suggestion.

posted @ 2020-06-03 23:49  励新  阅读(430)  评论(0)    收藏  举报