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

Error while using show_error argument of anno_enriched() #33

Closed lakhanp1 closed 5 years ago

lakhanp1 commented 5 years ago

Hi Zuguang,

I recently switched to latest versions of ComplexHeatmap and EnrichedHeatmap from GitHub. When I want to show enrichment summary as anno_enriched top annotation along with error regions (using show_error = T), I am getting error. Please refer below for the sample code from your EnrichedHeatmap tutorial.

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"))

EnrichedHeatmap(
  mat1, col = col_fun, name = "H3K4me3", row_km = 3,
  top_annotation = HeatmapAnnotation(
    enriched = anno_enriched(
      gp = gpar(col = 2:4, lty = 1:3),
      show_error = TRUE),
    annotation_height = unit(4, "cm")
  ),
  column_title = "Enrichment of H3K4me3", row_title_rot = 0)

This produces an error:

Error in colSds(mat[i, , drop = FALSE], na.rm = TRUE) : 
  could not find function "colSds"

This was working well with previous version. Can you please help to solve this. Thank you for your active development and support!!

~Lakhan.

jokergoo commented 5 years ago

I have no idea, maybe colSds was changed somewhere in the package. Nevertheless, I have changed colSds to matrixStats::colSds, and now it works fine. Please update the package.

lakhanp1 commented 5 years ago

Sure. Thank you very much Zuguang.