Skip to content

Commit

Permalink
Fixes plotting clustree when best k is in CLUSTER_KMEANS_K parameter
Browse files Browse the repository at this point in the history
Bug noticed by Lucie Pfeiferova. Error when tryint to create a tibble:  Column name `k1` must not be duplicated. Tibble wouldn't have unique column names because best would be a part of the k values. Fixed by taking only unique values.
  • Loading branch information
vucinick committed Jul 12, 2024
1 parent c153bd1 commit 2ba7d79
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/visualization.R
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,9 @@ dimred_plots_from_params_df <- function(sce_dimred, dimred_plots_params_df) {
#' @concept sce_visualization
#' @export
plot_clustree <- function(cluster_list, params, prefix, title = deparse(substitute(cluster_list)), edge_arrow = FALSE, highlight_core = TRUE, ...) {
cluster_list <- unique(cluster_list)
params <- unique(params)

assert_that_(length(cluster_list) == length(params))

clustree_list <- cluster_list %>%
Expand Down

0 comments on commit 2ba7d79

Please sign in to comment.