simplifyEnrichment icon indicating copy to clipboard operation
simplifyEnrichment copied to clipboard

Return dendrogram from binary_cut

Open GreenGilad opened this issue 2 years ago • 1 comments

After seeing I could not retrieve the dendrogram created by binary_cut (#78 ) I propose the following pull request where:

  1. I added return_dend = FALSE to both cluster_mat and cluster_mat2 (in the one there was already such an argument which was not in use)
  2. Moved the cl = as.numeric(as.vector(unname(cl))) line into these functions (instead of in binary_cut)
  3. Changed functions to return either just cl or a named list of cl and dend.
  4. Documentation and plot_binary_cut updated accordingly

Lastly, in cluster_terms, as all clustering methods must return a vector of clusters, I added that return_dend=FALSE. I think this should be removed and that returning a more complex object could be nice but that is a bigger change than I intended.

I tested the changes over my data and saw no problems

GreenGilad avatar Oct 18 '22 05:10 GreenGilad

After investigating the returned dendrogram I find it useful to include the split attributes added in cut_dend to the actual dendrogram returned. The dendrogram together with the split information is useful when considering different "resolutions" of the clustering

GreenGilad avatar Oct 18 '22 06:10 GreenGilad