Skip to content

"Error: Column names are not allowed in enriched heatmap — persists even after dimnames(NULL)" #89

@amechakra

Description

@amechakra

Bug Report: Column names are not allowed in enriched heatmap persists even after removing dimnames
Issue Summary
When attempting to create an EnrichedHeatmap with row_split, the following error occurs:

Error: Column names are not allowed in enriched heatmap.
This persists even after converting to a plain matrix and explicitly setting dimnames(mat) <- NULL.

System Information
R version 4.2.1 (2022-06-23)OS: macOS 14 / Ubuntu 22.04
EnrichedHeatmap version: EnrichedHeatmap_1.28.1
ComplexHeatmap version: ComplexHeatmap_2.14.0

###Minimal Reproducible Example
library(EnrichedHeatmap)
library(ComplexHeatmap)
library(circlize)

Simulated data

mat <- matrix(runif(200), nrow = 20)
rownames(mat) <- NULL
colnames(mat) <- NULL # explicitly removed

fake row_split (20 values)

split <- rep(c("A", "B"), each = 10)
names(split) <- paste0("gene_", 1:20)

Remove column names again for safety

dimnames(mat) <- NULL

Attempt to plot

draw(
EnrichedHeatmap(mat, name = "Test", col = colorRamp2(c(0, 1), c("white", "blue")),
row_split = split,
show_row_names = FALSE, show_column_names = FALSE)
)

#What I Tried
Converted normalizedMatrix to plain matrix using as.matrix(...)
Explicitly ran dimnames(mat) <- NULL
Verified class(mat) returns only "matrix"
Verified is.null(colnames(mat)) returns TRUE
Still received: Column names are not allowed in enriched heatmap.

Please confirm if there's an internal check that might be tripping on hidden attributes or unstripped names.
Could you consider making the internal check more robust, or accepting matrix objects with dimnames explicitly set to NULL?

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