jokergoo / EnrichedHeatmap

make enriched heatmap which visualizes the enrichment of genomic signals to specific target regions.
http://jokergoo.github.io/EnrichedHeatmap/
Other
187 stars 25 forks source link

Height of column title box #48

Closed dktanwar closed 4 years ago

dktanwar commented 4 years ago

Hi @jokergoo

How can I change the height of the column title box?

Screenshot 2020-08-13 at 11 56 24

I tried:

column_title_gp = gpar(box_height = unit(5, "mm"))
column_title_gp = gpar(height = unit(5, "mm"))
ht_opt$simple_anno_size <- unit(2, "mm")

Nothing worked!

jokergoo commented 4 years ago

Do want to fix the font size while just increase the height where the title sits? Then you can do e.g.:

ht_opt$TITLE_PADDING = unit(5, "mm")

before the call of Heatmap() function.

dktanwar commented 4 years ago

Thank you, @jokergoo! So, if I understood correctly, you are trying to reduce the padding across the title.

Doesn't seem to be working!

library(EnrichedHeatmap)

set.seed(123)
load(system.file("extdata", "chr21_test_data.RData", package = "EnrichedHeatmap"))

tss <- promoters(genes, upstream = 0, downstream = 1)

mat1 <- normalizeToMatrix(H3K4me3, tss,
  value_column = "coverage",
  extend = 5000, mean_mode = "w0", w = 50
)
ht_opt$TITLE_PADDING <- unit(1, "mm")
EnrichedHeatmap(mat1,
  name = "H3K4me3", ,
  column_title = "H3K4me3",
  column_title_gp = gpar(fontfamily = "Helvetica", fontsize = 6, fill = "grey")
)

Screenshot 2020-08-13 at 13 01 26

ht_opt$TITLE_PADDING <- unit(20, "mm")
EnrichedHeatmap(mat1,
                name = "H3K4me3", ,
                column_title = "H3K4me3",
                column_title_gp = gpar(fontfamily = "Helvetica", fontsize = 6, fill = "grey")
)

Screenshot 2020-08-13 at 13 02 01

Am I doing something wrong here?

jokergoo commented 4 years ago

Then update both ComplexHeatmap and EnrichedHeatmap to the newest versions (from GitHub). See the following plot from my side:

image

dktanwar commented 4 years ago

Ah!

Solved!

Thank you so much!