pheatmap , Clustering tree down

I'm trying to plot a picture by pheatmap package, but when clusting the rows, the tree's direction is downside rather than upwards. pls help me, thank you.

pheatmap(fpkm.no0,scale = 'row',clustering_distance_rows = 'euclidean',cluster_cols = T,
clustering_method = 'median',angle_col = 45,fontsize = 30,treeheight_col = 60,
treeheight_row = 60,fontfamily = 'serif',fontsize_number = 25,show_rownames = F,
color = colorRampPalette(c('#669999','white','#003366'))(30))

The reason is likely the clustering_method = 'median' as explained in the documentation:

Note however, that methods "median" and "centroid" are not leading to a monotone distance measure, or equivalently the resulting dendrograms can have so called inversions or reversals which are hard to interpret, but note the trichotomies in Legendre and Legendre (2012).

So apparently it's not unexpected, as to what you should do, I don't know. Maybe don't use median as a method, or you can try and follow this suggestion.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.