Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DoHeatMap: (a) average expression between 2 groups (b) what is "qcvygnwslzirbhfauxpt" in the identity legend #4660

Closed
levinhein opened this issue Jun 19, 2021 · 3 comments

Comments

@levinhein
Copy link

levinhein commented Jun 19, 2021

Hello. I have 2 questions about the DoHeatmap() function:

(a) Can I average the expression between 2 compared groups? How?

As you can see from the heatmap, I am comparing the Monocyte/Macrophage DEGs in "KD" vs "NKD" groups. Since there is an unequal number of Monocyte/Macrophage cells in the 2 groups, the KD region of the heatmap is short and the NKD region is long. I would like to know whether and how can I just average the expression of each DEG (row) in all cells per group so that the heatmap visualization can show balanced areas of heatmap?

(b) what is "qcvygnwslzirbhfauxpt" in the identity legend

Every time I run the DoHeatmap() function, a random string of letters shows under the Identity legend of the heatmap. I wonder what is this and how can I get rid of it if it is an error? This string of letters changes every time I repeatedly run the same line of code.

image

Here's the code that I use:

########## MONOCYTE/MACROPHAGE: NKD VS KD
Idents(KD.combinedA) <- "cell_type"
MonoMacro <- subset(KD.combinedA, idents = "1_Mono/Macro")
Idents(MonoMacro) <- "celltype_group"
KD.MonoMacro <- FindAllMarkers(object = MonoMacro, only.pos = TRUE, min.pct = 0.25, logfc.threshold = 2)
head(KD.MonoMacro)
top10 <- KD.MonoMacro %>% group_by(cluster) %>% top_n(n = 10, wt = avg_log2FC)
MonoMacro@[email protected] <- scale(MonoMacro@assays$RNA@data, scale = TRUE)
DoHeatmap(MonoMacro, features = top10$gene) + scale_fill_gradientn(colors = c("blue", "black", "red"))
@ychen983384
Copy link

I got the similar random text in the legend of heatmap plot using the pbmc3k.final object provided by Seurat. The run code is below:
library(Seurat)
library(SeuratData)
library(SeuratObject)
SeuratData::InstallData("pbmc3k")
data("pbmc3k.final")
features <- c("LYZ", "CCL5", "IL32", "PTPRCAP", "FCGR3A", "PF4")
DoHeatmap(subset(pbmc3k.final, downsample = 100), features = features, size = 3)
sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

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

other attached packages:
[1] pbmc3k.SeuratData_3.1.4 SeuratData_0.2.1 SeuratObject_4.0.2 Seurat_4.0.3

loaded via a namespace (and not attached):
[1] nlme_3.1-152 matrixStats_0.59.0 spatstat.sparse_2.0-0 RcppAnnoy_0.0.18 RColorBrewer_1.1-2
[6] httr_1.4.2 sctransform_0.3.2 tools_4.1.0 utf8_1.2.1 R6_2.5.0
[11] irlba_2.3.3 rpart_4.1-15 KernSmooth_2.23-20 uwot_0.1.10 mgcv_1.8-35
[16] DBI_1.1.1 lazyeval_0.2.2 colorspace_2.0-1 tidyselect_1.1.1 gridExtra_2.3
[21] compiler_4.1.0 cli_2.5.0 plotly_4.9.4 labeling_0.4.2 scales_1.1.1
[26] lmtest_0.9-38 spatstat.data_2.1-0 ggridges_0.5.3 pbapply_1.4-3 rappdirs_0.3.3
[31] goftest_1.2-2 stringr_1.4.0 digest_0.6.27 spatstat.utils_2.2-0 pkgconfig_2.0.3
[36] htmltools_0.5.1.1 parallelly_1.26.0 fastmap_1.1.0 htmlwidgets_1.5.3 rlang_0.4.11
[41] rstudioapi_0.13 shiny_1.6.0 farver_2.1.0 generics_0.1.0 zoo_1.8-9
[46] jsonlite_1.7.2 ica_1.0-2 dplyr_1.0.6 magrittr_2.0.1 patchwork_1.1.1
[51] Matrix_1.3-3 Rcpp_1.0.6 munsell_0.5.0 fansi_0.5.0 abind_1.4-5
[56] reticulate_1.20 lifecycle_1.0.0 stringi_1.6.1 MASS_7.3-54 Rtsne_0.15
[61] plyr_1.8.6 grid_4.1.0 parallel_4.1.0 listenv_0.8.0 promises_1.2.0.1
[66] ggrepel_0.9.1 crayon_1.4.1 deldir_0.2-10 miniUI_0.1.1.1 lattice_0.20-44
[71] cowplot_1.1.1 splines_4.1.0 tensor_1.5 pillar_1.6.1 igraph_1.2.6
[76] spatstat.geom_2.2-0 future.apply_1.7.0 reshape2_1.4.4 codetools_0.2-18 leiden_0.3.8
[81] glue_1.4.2 data.table_1.14.0 png_0.1-7 vctrs_0.3.8 httpuv_1.6.1
[86] polyclip_1.10-0 gtable_0.3.0 RANN_2.6.1 purrr_0.3.4 spatstat.core_2.1-2
[91] tidyr_1.1.3 scattermore_0.7 future_1.21.0 assertthat_0.2.1 ggplot2_3.3.4
[96] mime_0.10 xtable_1.8-4 later_1.2.0 survival_3.2-11 viridisLite_0.4.0
[101] tibble_3.1.2 cluster_2.1.2 globals_0.14.0 fitdistrplus_1.1-5 ellipsis_0.3.2
[106] ROCR_1.0-11
image

@JTpath
Copy link

JTpath commented Jul 16, 2021

I have the same issue, the weird set of letters changes every time I run DoHeatmap.

library(Seurat)
#> Registered S3 method overwritten by 'spatstat.geom':
#>   method     from
#>   print.boxx cli
#> Attaching SeuratObject

DoHeatmap(pbmc_small)

Created on 2021-07-16 by the reprex package (v2.0.0)

Session info
sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 4.0.5 (2021-03-31)
 os       macOS Big Sur 11.4          
 system   x86_64, darwin17.0          
 ui       RStudio                     
 language (EN)                        
 collate  en_GB.UTF-8                 
 ctype    en_GB.UTF-8                 
 tz       Europe/London               
 date     2021-07-16Packages ───────────────────────────────────────────────────────────────────────────────────────────
 package         * version    date       lib source                                 
 abind             1.4-5      2016-07-21 [1] CRAN (R 4.0.2)                         
 argon2            0.2-0      2017-06-12 [1] CRAN (R 4.0.2)                         
 assertthat        0.2.1      2019-03-21 [1] CRAN (R 4.0.2)                         
 backports         1.2.1      2020-12-09 [1] CRAN (R 4.0.2)                         
 bslib             0.2.5.1    2021-05-18 [1] CRAN (R 4.0.2)                         
 cachem            1.0.5      2021-05-15 [1] CRAN (R 4.0.2)                         
 callr             3.7.0      2021-04-20 [1] CRAN (R 4.0.2)                         
 cli               3.0.0      2021-06-30 [1] CRAN (R 4.0.2)                         
 clipr             0.7.1      2020-10-08 [1] CRAN (R 4.0.2)                         
 cluster           2.1.2      2021-04-17 [1] CRAN (R 4.0.2)                         
 codetools         0.2-18     2020-11-04 [1] CRAN (R 4.0.5)                         
 colorspace        2.0-2      2021-06-24 [1] CRAN (R 4.0.2)                         
 cowplot           1.1.1      2020-12-30 [1] CRAN (R 4.0.2)                         
 crayon            1.4.1      2021-02-08 [1] CRAN (R 4.0.2)                         
 data.table        1.14.0     2021-02-21 [1] CRAN (R 4.0.2)                         
 DBI               1.1.1      2021-01-15 [1] CRAN (R 4.0.3)                         
 deldir            0.2-10     2021-02-16 [1] CRAN (R 4.0.2)                         
 digest            0.6.27     2020-10-24 [1] CRAN (R 4.0.2)                         
 dplyr             1.0.7      2021-06-18 [1] CRAN (R 4.0.2)                         
 ellipsis          0.3.2      2021-04-29 [1] CRAN (R 4.0.2)                         
 evaluate          0.14       2019-05-28 [1] CRAN (R 4.0.1)                         
 fansi             0.5.0      2021-05-25 [1] CRAN (R 4.0.2)                         
 farver            2.1.0      2021-02-28 [1] CRAN (R 4.0.3)                         
 fastmap           1.1.0      2021-01-25 [1] CRAN (R 4.0.2)                         
 fitdistrplus      1.1-5      2021-05-28 [1] CRAN (R 4.0.5)                         
 fs                1.5.0      2020-07-31 [1] CRAN (R 4.0.2)                         
 future            1.21.0     2020-12-10 [1] CRAN (R 4.0.3)                         
 future.apply      1.7.0      2021-01-04 [1] CRAN (R 4.0.2)                         
 generics          0.1.0      2020-10-31 [1] CRAN (R 4.0.2)                         
 getPass           0.2-2      2017-07-21 [1] CRAN (R 4.0.2)                         
 ggplot2           3.3.5      2021-06-25 [1] CRAN (R 4.0.2)                         
 ggrepel           0.9.1      2021-01-15 [1] CRAN (R 4.0.2)                         
 ggridges          0.5.3      2021-01-08 [1] CRAN (R 4.0.2)                         
 globals           0.14.0     2020-11-22 [1] CRAN (R 4.0.2)                         
 glue              1.4.2      2020-08-27 [1] CRAN (R 4.0.2)                         
 goftest           1.2-2      2019-12-02 [1] CRAN (R 4.0.2)                         
 gridExtra         2.3        2017-09-09 [1] CRAN (R 4.0.2)                         
 gtable            0.3.0      2019-03-25 [1] CRAN (R 4.0.2)                         
 highr             0.9        2021-04-16 [1] CRAN (R 4.0.5)                         
 htmltools         0.5.1.1    2021-01-22 [1] CRAN (R 4.0.2)                         
 htmlwidgets       1.5.3      2020-12-10 [1] CRAN (R 4.0.3)                         
 httpuv            1.6.1      2021-05-07 [1] CRAN (R 4.0.2)                         
 httr              1.4.2      2020-07-20 [1] CRAN (R 4.0.2)                         
 ica               1.0-2      2018-05-24 [1] CRAN (R 4.0.2)                         
 igraph            1.2.6      2020-10-06 [1] CRAN (R 4.0.2)                         
 irlba             2.3.3      2019-02-05 [1] CRAN (R 4.0.2)                         
 jquerylib         0.1.4      2021-04-26 [1] CRAN (R 4.0.2)                         
 jsonlite          1.7.2      2020-12-09 [1] CRAN (R 4.0.2)                         
 KernSmooth        2.23-20    2021-05-03 [1] CRAN (R 4.0.2)                         
 knitr             1.33       2021-04-24 [1] CRAN (R 4.0.2)                         
 labeling          0.4.2      2020-10-20 [1] CRAN (R 4.0.2)                         
 later             1.2.0      2021-04-23 [1] CRAN (R 4.0.2)                         
 lattice           0.20-44    2021-05-02 [1] CRAN (R 4.0.2)                         
 lazyeval          0.2.2      2019-03-15 [1] CRAN (R 4.0.2)                         
 leiden            0.3.8      2021-05-24 [1] CRAN (R 4.0.5)                         
 lifecycle         1.0.0      2021-02-15 [1] CRAN (R 4.0.2)                         
 listenv           0.8.0      2019-12-05 [1] CRAN (R 4.0.2)                         
 lmtest            0.9-38     2020-09-09 [1] CRAN (R 4.0.2)                         
 magrittr          2.0.1      2020-11-17 [1] CRAN (R 4.0.2)                         
 MASS              7.3-54     2021-05-03 [1] CRAN (R 4.0.2)                         
 Matrix            1.3-4      2021-06-01 [1] CRAN (R 4.0.2)                         
 matrixStats       0.59.0     2021-06-01 [1] CRAN (R 4.0.2)                         
 mgcv              1.8-36     2021-06-01 [1] CRAN (R 4.0.2)                         
 mime              0.11       2021-06-23 [1] CRAN (R 4.0.2)                         
 miniUI            0.1.1.1    2018-05-18 [1] CRAN (R 4.0.2)                         
 munsell           0.5.0      2018-06-12 [1] CRAN (R 4.0.2)                         
 nlme              3.1-152    2021-02-04 [1] CRAN (R 4.0.5)                         
 parallelly        1.26.1     2021-06-30 [1] CRAN (R 4.0.2)                         
 patchwork         1.1.1      2020-12-17 [1] CRAN (R 4.0.2)                         
 pbapply           1.4-3      2020-08-18 [1] CRAN (R 4.0.2)                         
 pillar            1.6.1      2021-05-16 [1] CRAN (R 4.0.2)                         
 pkgconfig         2.0.3      2019-09-22 [1] CRAN (R 4.0.2)                         
 plotly            4.9.4.1    2021-06-18 [1] CRAN (R 4.0.2)                         
 plyr              1.8.6      2020-03-03 [1] CRAN (R 4.0.2)                         
 png               0.1-7      2013-12-03 [1] CRAN (R 4.0.2)                         
 polyclip          1.10-0     2019-03-14 [1] CRAN (R 4.0.2)                         
 processx          3.5.2      2021-04-30 [1] CRAN (R 4.0.2)                         
 promises          1.2.0.1    2021-02-11 [1] CRAN (R 4.0.2)                         
 ps                1.6.0      2021-02-28 [1] CRAN (R 4.0.3)                         
 purrr             0.3.4      2020-04-17 [1] CRAN (R 4.0.2)                         
 R6                2.5.0      2020-10-28 [1] CRAN (R 4.0.2)                         
 RANN              2.6.1      2019-01-08 [1] CRAN (R 4.0.2)                         
 RColorBrewer      1.1-2      2014-12-07 [1] CRAN (R 4.0.2)                         
 Rcpp              1.0.7      2021-07-07 [1] CRAN (R 4.0.2)                         
 RcppAnnoy         0.0.18     2020-12-15 [1] CRAN (R 4.0.2)                         
 remoter           0.4-0      2018-01-05 [1] CRAN (R 4.0.2)                         
 reprex            2.0.0      2021-04-02 [1] CRAN (R 4.0.2)                         
 reshape2          1.4.4      2020-04-09 [1] CRAN (R 4.0.2)                         
 reticulate        1.20       2021-05-03 [1] CRAN (R 4.0.2)                         
 rlang             0.4.11     2021-04-30 [1] CRAN (R 4.0.2)                         
 rmarkdown         2.9        2021-06-15 [1] CRAN (R 4.0.5)                         
 ROCR              1.0-11     2020-05-02 [1] CRAN (R 4.0.2)                         
 rpart             4.1-15     2019-04-12 [1] CRAN (R 4.0.5)                         
 rstudioapi        0.13       2020-11-12 [1] CRAN (R 4.0.2)                         
 Rtsne             0.15       2018-11-10 [1] CRAN (R 4.0.2)                         
 sass              0.4.0      2021-05-12 [1] CRAN (R 4.0.2)                         
 scales            1.1.1      2020-05-11 [1] CRAN (R 4.0.2)                         
 scattermore       0.7        2020-11-24 [1] CRAN (R 4.0.2)                         
 sctransform       0.3.2.9007 2021-07-06 [1] Github (ChristophH/sctransform@c87648b)
 sessioninfo       1.1.1      2018-11-05 [1] CRAN (R 4.0.2)                         
 Seurat          * 4.0.3.9009 2021-07-14 [1] Github (satijalab/seurat@62a43ef)      
 SeuratObject    * 4.0.2      2021-06-09 [1] CRAN (R 4.0.2)                         
 shiny           * 1.6.0      2021-01-25 [1] CRAN (R 4.0.3)                         
 sodium            1.1        2017-03-30 [1] CRAN (R 4.0.2)                         
 spatstat.core     2.2-0      2021-06-17 [1] CRAN (R 4.0.2)                         
 spatstat.data     2.1-0      2021-03-21 [1] CRAN (R 4.0.3)                         
 spatstat.geom     2.2-0      2021-06-15 [1] CRAN (R 4.0.2)                         
 spatstat.sparse   2.0-0      2021-03-16 [1] CRAN (R 4.0.2)                         
 spatstat.utils    2.2-0      2021-06-14 [1] CRAN (R 4.0.2)                         
 stringi           1.6.2      2021-05-17 [1] CRAN (R 4.0.2)                         
 stringr           1.4.0      2019-02-10 [1] CRAN (R 4.0.2)                         
 styler            1.4.1      2021-03-30 [1] CRAN (R 4.0.2)                         
 survival          3.2-11     2021-04-26 [1] CRAN (R 4.0.2)                         
 tensor            1.5        2012-05-05 [1] CRAN (R 4.0.2)                         
 tibble            3.1.2      2021-05-16 [1] CRAN (R 4.0.2)                         
 tidyr             1.1.3      2021-03-03 [1] CRAN (R 4.0.3)                         
 tidyselect        1.1.1      2021-04-30 [1] CRAN (R 4.0.2)                         
 utf8              1.2.1      2021-03-12 [1] CRAN (R 4.0.2)                         
 uwot              0.1.10     2020-12-15 [1] CRAN (R 4.0.2)                         
 vctrs             0.3.8      2021-04-29 [1] CRAN (R 4.0.2)                         
 viridisLite       0.4.0      2021-04-13 [1] CRAN (R 4.0.5)                         
 withr             2.4.2      2021-04-18 [1] CRAN (R 4.0.5)                         
 xfun              0.24       2021-06-15 [1] CRAN (R 4.0.2)                         
 xtable            1.8-4      2019-04-21 [1] CRAN (R 4.0.2)                         
 yaml              2.2.1      2020-02-01 [1] CRAN (R 4.0.2)                         
 zoo               1.8-9      2021-03-09 [1] CRAN (R 4.0.2)                         

[1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

andrewwbutler pushed a commit that referenced this issue Jul 30, 2021
@andrewwbutler
Copy link
Collaborator

Hi all,

Thanks for reporting. This should be fixed now on the develop branch (installation instructions here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants