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

Position line color not uniform for top annotation and main heatmap body #34

Closed lakhanp1 closed 5 years ago

lakhanp1 commented 5 years ago

Hi Zuguang,

I am using the latest updated EnrichedHeatmap package (v1.13.1) from GitHub. I wanted to change position line color using pos_line_gp option. I noticed that when I change the color in gpar() argument, the line color is not changed for top annotation. The color is reflected correctly for main heatmap body whereas the top annotation position line is still in default black color. Please refer below for the reproducible example.

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)

col_fun = circlize::colorRamp2(quantile(mat1, c(0, 0.99)), c("white", "red"))

## color of the position line is different for annotation and heatmap body
EnrichedHeatmap(
  mat1, col = col_fun, name = "H3K4me3", row_km = 3,
  top_annotation = HeatmapAnnotation(
    enriched = anno_enriched(
      gp = gpar(col = 2:4, lty = 1:3)),
    annotation_height = unit(4, "cm")
  ),
  column_title = "Enrichment of H3K4me3", row_title_rot = 0,
  pos_line_gp = gpar(lty = 2, col = "#F4A460", lwd = 1))

rplot

Thank you! ~Lakhan.

jokergoo commented 5 years ago

Actually you need to manually set pos_line and pos_line_gp in anno_enriched() as well.

But thanks to your comment, now by default pos_line and pos_line_gp in anno_enriched() will take the same value in EnrichedHeatmap() that if you try your code again, the vertical line in the annotation will be orange.

jokergoo commented 5 years ago

If you also update ComplexHeatmap package, you can find the order of k-kmeans slices now are nicely set.

image

lakhanp1 commented 5 years ago

Thank you Zuguang. Yes, I updated to latest ComplexHeatmap and the new features are really good.