Set the number of leaves of dendrogram in R's pheatmap

33 Views Asked by At

How can I define the number of leaves in the row of the pheatmap.

pheatmap(res_sig,color = heat_colors, cluster_rows = TRUE,show_rownames = FALSE, clustering_method="ward.D2",scale = "row")

Also, Once I define the number of leaves/clusters, will the ordering of the genes (row-wise) in the heatmap change.

I've tried the cuttree option, but this simply adds space between a set of genes. I want to reduce the number of dendogram leaves.

Tried reading ?pheatmap doc and searching for argument that allows you to define the number of clusters. Similarily searched for similar arguments in other library like ComplexHeatmap.

0

There are 0 best solutions below