How to set a seed for the k-clustering in my pheatmaps?
0
0
Entering edit mode
22 months ago
Berta • 0

I want to use pheatmaps() to plot my RNA-seq counts with k-means clustering, but anytime that I rerun my code, my clusters would change.

Changes are not extreme, but enough for me to not trust them. I have read that by setting a seed/randomstate they will be reproducible due to the internal calculations while k-clustering. I have tried with set.seed(123) but it would not make any effects.

Any ideas of how to solve this?

My code:

set.seed(123)
pheatmap.clustering<- pheatmap(mydataset,                     
                                            cluster_cols = FALSE,
                                            cluster_row = TRUE,
                                            kmeans_k=5)(100)
)

Thanks so much!

pheatmap k-clustering heatmap kmeans clustering • 629 views
ADD COMMENT

Login before adding your answer.

Traffic: 1444 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6