How to set a seed for the k-clustering in my pheatmaps?
0
0
Entering edit mode
5 days 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!