jokergoo / InteractiveComplexHeatmap

Make Interactive Complex Heatmaps
https://jokergoo.github.io/InteractiveComplexHeatmap/
Other
126 stars 23 forks source link

Sub-heatmap does not work with annotations #83

Closed tatiana-gelaf closed 2 years ago

tatiana-gelaf commented 2 years ago

Hello, I'm encountering a bug with v1.2.0 when I try to create a Sub-heatmap with row/column annotations. I attempted to run htShinyExample(1.3). When I try to select a region to highlight, I get the following error:

Error: error in evaluating the argument 'x' in selecting a method for function 'which': no slot of name "subsetable" for this object of class "SingleAnnotation"

No stack trace is available. In the GUI, it looks like this: image

There is no such error when I attempt to use the functionality without annotations.

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.6.3

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] EnvStats_2.5.0                  outliers_0.14                   shiny_1.7.1                     InteractiveComplexHeatmap_1.2.0
 [5] BiocManager_1.30.16             ComplexHeatmap_2.11.1           data.table_1.14.2               bigrquery_1.4.0                
 [9] biomaRt_2.50.3                  forcats_0.5.1                   stringr_1.4.0                   dplyr_1.0.8                    
[13] purrr_0.3.4                     readr_2.1.2                     tidyr_1.2.0                     tibble_3.1.6                   
[17] ggplot2_3.3.5                   tidyverse_1.3.1                 httr_1.4.2                     

loaded via a namespace (and not attached):
  [1] colorspace_2.0-2       rjson_0.2.21           ellipsis_0.3.2         circlize_0.4.14        XVector_0.34.0         GlobalOptions_0.1.2   
  [7] fs_1.5.2               clue_0.3-60            rstudioapi_0.13        bit64_4.0.5            AnnotationDbi_1.56.2   fansi_1.0.2           
 [13] lubridate_1.8.0        xml2_1.3.3             codetools_0.2-18       doParallel_1.0.17      cachem_1.0.6           knitr_1.37            
 [19] jsonlite_1.7.3         broom_0.7.12           cluster_2.1.2          dbplyr_2.1.1           png_0.1-7              compiler_4.1.2        
 [25] backports_1.4.1        assertthat_0.2.1       fastmap_1.1.0          gargle_1.2.0           cli_3.2.0              later_1.3.0           
 [31] htmltools_0.5.2        prettyunits_1.1.1      tools_4.1.2            gtable_0.3.0           glue_1.6.1             GenomeInfoDbData_1.2.7
 [37] rappdirs_0.3.3         Rcpp_1.0.8             Biobase_2.54.0         jquerylib_0.1.4        cellranger_1.1.0       vctrs_0.3.8           
 [43] Biostrings_2.62.0      svglite_2.1.0          iterators_1.0.14       xfun_0.29              rvest_1.0.2            mime_0.12             
 [49] lifecycle_1.0.1        XML_3.99-0.8           zlibbioc_1.40.0        scales_1.1.1           clisymbols_1.2.0       hms_1.1.1             
 [55] promises_1.2.0.1       parallel_4.1.2         RColorBrewer_1.1-2     yaml_2.2.2             curl_4.3.2             memoise_2.0.1         
 [61] sass_0.4.0             stringi_1.7.6          RSQLite_2.2.9          highr_0.9              S4Vectors_0.32.3       foreach_1.5.2         
 [67] BiocGenerics_0.40.0    filelock_1.0.2         shape_1.4.6            GenomeInfoDb_1.30.1    systemfonts_1.0.4      rlang_1.0.1           
 [73] pkgconfig_2.0.3        bitops_1.0-7           matrixStats_0.61.0     fontawesome_0.2.2      evaluate_0.14          bit_4.0.4             
 [79] tidyselect_1.1.1       magrittr_2.0.2         R6_2.5.1               IRanges_2.28.0         generics_0.1.2         DBI_1.1.2             
 [85] pillar_1.7.0           haven_2.4.3            withr_2.4.3            KEGGREST_1.34.0        RCurl_1.98-1.6         modelr_0.1.8          
 [91] crayon_1.5.0           utf8_1.2.2             BiocFileCache_2.2.1    tzdb_0.2.0             rmarkdown_2.11         GetoptLong_1.0.5      
 [97] progress_1.2.2         readxl_1.3.1           blob_1.2.2             webshot_0.5.2          reprex_2.0.1           digest_0.6.29         
[103] xtable_1.8-4           httpuv_1.6.5           stats4_4.1.2           munsell_0.5.0          viridisLite_0.4.0      kableExtra_1.3.4      
[109] bslib_0.3.1
jokergoo commented 2 years ago

You should update the ComplexHeatmap package (better from GitHub). One slot name has been changed.

tatiana-gelaf commented 2 years ago

Thanks for the quick response! Looking at the ComplexHeatmap code, I don't think the issue would be resolved by updating to the Github version (in fact I do have the latest version, 2.11.1, installed). We can see here: https://github.com/jokergoo/ComplexHeatmap/blob/6f35b6e61f9d2ab198f23f9b66b9e1c54a6dbc25/R/AnnotationFunction-function.R#L413 The slot is named subsettable. In InteractiveComplexHeatmap here: https://github.com/jokergoo/InteractiveComplexHeatmap/blob/dfdc827328ebefe6e3e8569f80f3eae700a00a61/R/shiny-server.R#L1024 (and a few other places within that file), the slot is called subsetable, which I believe is a typo. I modified my local version of the InteractiveComplexHeatmap by switching all instances of subsetable to subsettable and it seems to fix the issue.

jokergoo commented 2 years ago

That is right! I totally forgot that!

Now I have changed all "subsetable" to "subsettable". Please use InteractiveComplexHeatmap version 1.3.1 on GitHub. I also set the dependency of ComplexHeatmap to a more recent version.

And finally, thanks!

tatiana-gelaf commented 2 years ago

Thank you!!