HelenaLC / CATALYST

Cytometry dATa anALYsis Tools
66 stars 30 forks source link

How to change condition bar color in the plotExprHeatmap function #394

Closed TongzhenXu closed 1 month ago

TongzhenXu commented 1 month ago

Dear Helena L. Crowell,

I am currently working on a CyTOF workflow in R using CATALYST. I have been using the plotExprHeatmap function to generate heatmap images, and I'm seeking guidance on how to modify the colors of the 'condition' bars, in my case, the ”type“ bar in these images.

Specifically, I aim to adjust the bar colors associated with different types displayed in the heatmap. Could you kindly provide insights or examples on how to implement this modification within the R code? Thank you very much for your time and assistance. I look forward to your guidance on this matter.

p <- plotExprHeatmap(sce, bin_anno = TRUE, row_anno = TRUE, row_clust = FALSE )

sessionInfo() R version 4.4.0 (2024-04-24 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows 11 x64 (build 22631) Matrix products: default locale: [1] LC_COLLATE=Chinese (Simplified)_China.utf8 LC_CTYPE=Chinese (Simplified)_China.utf8 LC_MONETARY=Chinese (Simplified)_China.utf8 [4] LC_NUMERIC=C LC_TIME=Chinese (Simplified)_China.utf8 time zone: Asia/Shanghai tzcode source: internal attached base packages: [1] grid stats4 stats graphics grDevices utils datasets methods base other attached packages: [1] cowplot_1.1.3 ggpubr_0.6.0 scater_1.32.0 scuttle_1.14.0 CATALYST_1.28.0 flowCore_2.16.0 [7] ComplexHeatmap_2.20.0 SingleCellExperiment_1.26.0 SummarizedExperiment_1.34.0 Biobase_2.64.0 GenomicRanges_1.56.0 GenomeInfoDb_1.40.1 [13] IRanges_2.38.0 S4Vectors_0.42.0 BiocGenerics_0.50.0 MatrixGenerics_1.16.0 matrixStats_1.3.0 draw_1.0.0 [19] ggplot2_3.5.1 xlsx_0.6.5 readxl_1.4.3 loaded via a namespace (and not attached): [1] RColorBrewer_1.1-3 rstudioapi_0.16.0 jsonlite_1.8.8 shape_1.4.6.1 magrittr_2.0.3 TH.data_1.1-2 [7] ggbeeswarm_0.7.2 farver_2.1.2 GlobalOptions_0.1.2 zlibbioc_1.50.0 vctrs_0.6.5 Cairo_1.6-2 [13] DelayedMatrixStats_1.26.0 rstatix_0.7.2 S4Arrays_1.4.1 plotrix_3.8-4 BiocNeighbors_1.22.0 broom_1.0.6 [19] cellranger_1.1.0 SparseArray_1.4.5 plyr_1.8.9 sandwich_3.1-0 zoo_1.8-12 igraph_2.0.3 [25] lifecycle_1.0.4 iterators_1.0.14 pkgconfig_2.0.3 rsvd_1.0.5 Matrix_1.7-0 R6_2.5.1 [31] GenomeInfoDbData_1.2.12 clue_0.3-65 digest_0.6.35 colorspace_2.1-0 ggnewscale_0.4.10 irlba_2.3.5.1 [37] pkgload_1.3.4 beachmat_2.20.0 labeling_0.4.3 cytolib_2.16.0 fansi_1.0.6 colorRamps_2.3.4 [43] nnls_1.5 httr_1.4.7 polyclip_1.10-6 abind_1.4-5 compiler_4.4.0 withr_3.0.0 [49] doParallel_1.0.17 ConsensusClusterPlus_1.68.0 backports_1.5.0 BiocParallel_1.38.0 carData_3.0-5 viridis_0.6.5 [55] ggforce_0.4.2 ggsignif_0.6.4 MASS_7.3-60.2 drc_3.0-1 DelayedArray_0.30.1 rjson_0.2.21 [61] FlowSOM_2.12.0 gtools_3.9.5 tools_4.4.0 vipor_0.4.7 beeswarm_0.4.0 glue_1.7.0 [67] Rtsne_0.17 cluster_2.1.6 reshape2_1.4.4 generics_0.1.3 gtable_0.3.5 tidyr_1.3.1 [73] data.table_1.15.4 BiocSingular_1.20.0 ScaledMatrix_1.12.0 car_3.1-2 utf8_1.2.4 XVector_0.44.0 [79] ggrepel_0.9.5 foreach_1.5.2 pillar_1.9.0 stringr_1.5.1 rJava_1.0-11 circlize_0.4.16 [85] splines_4.4.0 dplyr_1.1.4 tweenr_2.0.3 lattice_0.22-6 survival_3.7-0 RProtoBufLib_2.16.0 [91] tidyselect_1.2.1 gridExtra_2.3 stringi_1.8.4 UCSC.utils_1.0.0 xlsxjars_0.6.1 codetools_0.2-20 [97] tibble_3.2.1 cli_3.6.2 munsell_0.5.1 Rcpp_1.0.12 png_0.1-8 XML_3.99-0.16.1 [103] parallel_4.4.0 sparseMatrixStats_1.16.0 viridisLite_0.4.2 mvtnorm_1.2-5 scales_1.3.0 ggridges_0.5.6 [109] purrr_1.0.2 crayon_1.5.2 GetoptLong_1.0.5 rlang_1.1.4 multcomp_1.4-25

 

| >

TongzhenXu commented 1 month ago

20240614192135

HelenaLC commented 1 month ago

Asked and answered here #244 - let me know if that resolves things, or if you have further issues!

TongzhenXu commented 1 month ago

Asked and answered here #244 - let me know if that resolves things, or if you have further issues! This works. Thank you.