Skip to content

Incorrect numbers on reverse barplots #1247

@SciLiciumTheo

Description

@SciLiciumTheo

Hello,

There is an unwanted interaction between anno_barplot parameters axis_param = list(direction = "reverse") and add_numbers=TRUE.

Correct behavior:

set.seed(123)
lt = list(a = sample(letters, 5),
          b = sample(letters, 10),
          c = sample(letters, 15))
m1 = make_comb_mat(lt)

top_ha = HeatmapAnnotation(
    "normal" = anno_barplot(comb_size(m1),
                            gp = gpar(fill = "red"),
                            height = unit(2, "cm"),
                            add_numbers=TRUE), 
    "reverse" = anno_barplot(comb_size(m1),
                            gp = gpar(fill = "yellow"),
                            height = unit(2, "cm"),
                            axis_param = list(direction = "reverse")),
    gap = unit(2, "mm"), annotation_name_side = "left", annotation_name_rot = 0)
UpSet(m1, top_annotation = top_ha)

Image

Incorrect behavior:

top_ha = HeatmapAnnotation(
    "normal" = anno_barplot(comb_size(m1),
                            gp = gpar(fill = "red"),
                            height = unit(2, "cm")), 
    "reverse" = anno_barplot(comb_size(m1),
                            gp = gpar(fill = "yellow"),
                            height = unit(2, "cm"),
                            axis_param = list(direction = "reverse"),
                            add_numbers=TRUE),
    gap = unit(2, "mm"), annotation_name_side = "left", annotation_name_rot = 0)
UpSet(m1, top_annotation = top_ha)

Image

There are two issues here:

  1. The numbers are wrong (they correspond to something like barplot height - correct number)
  2. Their positition is incorrect, I would expect them to be below the bars, and not overlapping them

Best,
Theo

Edit 1:
This is with ComplexHeatmap_2.22.0 with R 4.4.2

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