This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to set a seed for the k-clustering in my pheatmaps?

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

0 answers

No answers yet.

Log in to answer this question.