Skip to content

plotDiffHeatmap : ambiguity when multiple clusterings could match #381

@SamGG

Description

@SamGG

IIUC, when multiple columns of cluster_codes could match the levels of cluster_id, the first one is selected silently.

if (is.null(k)) {
kids <- levels(y$cluster_id)
same <- vapply(cluster_codes(x), function(u)
identical(levels(u), kids), logical(1))
if (!any(same))
stop("Couldn't match any clustering",
" in input data 'x' with results in 'y'.")
k <- names(cluster_codes(x))[same][1]
} else {
k <- .check_k(x, k)
}
x$cluster_id <- cluster_ids(x, k)

IMO, if sum(same) > 1 a warning must be raised show the selected column/clustering, or, an error must be raised to force the user to select the clustering column (k argument).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions