samuel-marsh / scCustomize

R package with collection of functions created and/or curated to aid in the visualization and analysis of single-cell data using R.
https://samuel-marsh.github.io/scCustomize/
GNU General Public License v3.0
216 stars 24 forks source link

Clustered_DotPlot: Error in ComplexHeatmap::Legend #35

Closed Sophia409 closed 2 years ago

Sophia409 commented 2 years ago

Hello,

Thank you for your wonderful work!

I used Clustered_Dotplot, to visualize my dataset, but it always gives this error. I update the version to develop version,but difficulties remain.

library(SeuratData)
InstallData("pbmc3k")
data("pbmc3k")
pbmc <- pbmc3k.SeuratData::pbmc3k.final
pbmc <- UpdateSeuratObject(pbmc)
Clustered_DotPlot(seurat_object = pbmc, features = VariableFeatures(pbmc)[1:5])

Error in ComplexHeatmap::Legend(labels = c(0.25, 0.5, 0.75, 1), title = "Percent Expressing", : unused argument (graphics = list(function(x, y, w, h) grid.circle(x = x, y = y, r = sqrt(0.25) unit(2, "mm"), gp = gpar(fill = "black")), function(x, y, w, h) grid.circle(x = x, y = y, r = sqrt(0.5) unit(2, "mm"), gp = gpar(fill = "black")), function(x, y, w, h) grid.circle(x = x, y = y, r = sqrt(0.75) * unit(2, "mm"), gp = gpar(fill = "black")),

> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936  LC_CTYPE=Chinese (Simplified)_China.936    LC_MONETARY=Chinese (Simplified)_China.936
[4] LC_NUMERIC=C                               LC_TIME=Chinese (Simplified)_China.936    

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

other attached packages:
 [1] scCustomize_0.7.0.9908      pbmc3k.SeuratData_3.1.4     SeuratData_0.2.2            forcats_0.5.1               purrr_0.3.4                
 [6] readr_1.4.0                 tibble_3.1.6                tidyverse_1.3.1             rlang_1.0.1                 clusterProfiler_4.3.1      
[11] SeuratWrappers_0.3.0        stringr_1.4.0               Hmisc_4.5-0                 Formula_1.2-4               survival_3.2-11            
[16] lattice_0.20-44             scales_1.1.1                RColorBrewer_1.1-2          ggsci_2.9                   tidyr_1.1.3                
[21] slingshot_2.1.1             TrajectoryUtils_1.1.2       SingleCellExperiment_1.12.0 SummarizedExperiment_1.20.0 Biobase_2.50.0             
[26] GenomicRanges_1.42.0        GenomeInfoDb_1.26.7         IRanges_2.24.1              S4Vectors_0.28.1            BiocGenerics_0.36.1        
[31] MatrixGenerics_1.2.1        matrixStats_0.60.0          princurve_2.1.6             datapasta_3.1.0             heatmap3_1.1.9             
[36] pvclust_2.2-0               dendextend_1.15.1           dendsort_0.3.4              circlize_0.4.12             ComplexHeatmap_2.4.3       
[41] dplyr_1.0.7                 plyr_1.8.6                  tradeSeq_1.7.07             SeuratObject_4.0.4          Seurat_4.1.0               
[46] corrplot_0.88               cowplot_1.1.1               patchwork_1.1.1             ggplot2_3.3.3               reticulate_1.20            

loaded via a namespace (and not attached):
  [1] rsvd_1.0.5             ica_1.0-2              ps_1.6.0               lmtest_0.9-38          rprojroot_2.0.2        crayon_1.5.0          
  [7] spatstat.core_2.1-2    rbibutils_2.2.3        MASS_7.3-54            dittoSeq_1.9.0         nlme_3.1-152           backports_1.2.1       
 [13] reprex_2.0.0           GOSemSim_2.14.2        XVector_0.30.0         ROCR_1.0-11            readxl_1.3.1           irlba_2.3.3           
 [19] callr_3.7.0            limma_3.46.0           BiocParallel_1.24.1    rjson_0.2.20           bit64_4.0.5            glue_1.6.1            
 [25] pheatmap_1.0.12        sctransform_0.3.3      processx_3.5.2         vipor_0.4.5            spatstat.sparse_2.0-0  AnnotationDbi_1.52.0  
 [31] DOSE_3.14.0            spatstat.geom_2.3-2    haven_2.4.1            tidyselect_1.1.1       usethis_2.1.5          rio_0.5.27            
 [37] fitdistrplus_1.1-5     zoo_1.8-9              ggpubr_0.4.0           xtable_1.8-4           magrittr_2.0.2         Rdpack_2.1.2          
 [43] cli_3.2.0              zlibbioc_1.36.0        sn_2.0.0               rstudioapi_0.13        miniUI_0.1.1.1         rpart_4.1-15          
 [49] mathjaxr_1.4-0         fastmatch_1.1-3        shiny_1.6.0            xfun_0.29              clue_0.3-58            multtest_2.46.0       
 [55] pkgbuild_1.3.1         cluster_2.1.2          tidygraph_1.2.0        ggrepel_0.9.1          listenv_0.8.0          png_0.1-7             
 [61] future_1.21.0          withr_2.4.3            bitops_1.0-7           ggforce_0.3.3          cellranger_1.1.0       pillar_1.7.0          
 [67] GlobalOptions_0.1.2    cachem_1.0.6           multcomp_1.4-17        fs_1.5.2               GetoptLong_1.0.5       paletteer_1.4.0       
 [73] vctrs_0.3.8            ellipsis_0.3.2         generics_0.1.0         devtools_2.4.3         metap_1.4              tools_4.0.5           
 [79] foreign_0.8-81         beeswarm_0.4.0         munsell_0.5.0          tweenr_1.0.2           fgsea_1.14.0           DelayedArray_0.16.3   
 [85] fastmap_1.1.0          compiler_4.0.5         pkgload_1.2.4          abind_1.4-5            httpuv_1.6.1           sessioninfo_1.2.2     
 [91] clipr_0.7.1            plotly_4.9.3           GenomeInfoDbData_1.2.4 gridExtra_2.3          edgeR_3.30.3           colorway_0.2.0        
 [97] deldir_1.0-6           mutoss_0.1-12          utf8_1.2.2             later_1.2.0            prismatic_1.1.0        jsonlite_1.7.3        
[103] pbapply_1.4-3          carData_3.0-4          lazyeval_0.2.2         promises_1.2.0.1       car_3.0-11             latticeExtra_0.6-29   
[109] R.utils_2.10.1         goftest_1.2-2          spatstat.utils_2.3-0   checkmate_2.0.0        openxlsx_4.2.4         sandwich_3.0-1        
[115] Rtsne_0.15             downloader_0.4         uwot_0.1.10            igraph_1.2.6           plotrix_3.8-1          numDeriv_2016.8-1.1   
[121] htmltools_0.5.1.1      memoise_2.0.1          locfit_1.5-9.4         graphlayouts_0.7.1     viridisLite_0.4.0      digest_0.6.29         
[127] assertthat_0.2.1       rappdirs_0.3.3         mime_0.12              RSQLite_2.2.7          yulab.utils_0.0.4      future.apply_1.7.0    
[133] remotes_2.4.2          data.table_1.14.0      blob_1.2.2             R.oo_1.24.0            splines_4.0.5          labeling_0.4.2        
[139] rematch2_2.1.2         RCurl_1.98-1.3         broom_0.7.6            hms_1.1.0              modelr_0.1.8           colorspace_1.4-1      
[145] base64enc_0.1-3        BiocManager_1.30.16    mnormt_2.0.2           ggbeeswarm_0.6.0       shape_1.4.5            tmvnsim_1.0-2         
[151] ggrastr_0.2.3          nnet_7.3-16            Rcpp_1.0.7             RANN_2.6.1             mvtnorm_1.1-2          enrichplot_1.10.2     
[157] fansi_1.0.2            brio_1.1.3             parallelly_1.25.0      R6_2.5.1               ggridges_0.5.3         lifecycle_1.0.1       
[163] zip_2.2.0              TFisher_0.2.0          curl_4.3.2             ggsignif_0.6.2         leiden_0.3.8           testthat_3.1.2        
[169] snakecase_0.11.0       fastcluster_1.2.3      DO.db_2.9              Matrix_1.4-0           qvalue_2.20.0          TH.data_1.0-10        
[175] desc_1.4.0             RcppAnnoy_0.0.18       htmlwidgets_1.5.3      polyclip_1.10-0        shadowtext_0.0.9       rvest_1.0.0           
[181] mgcv_1.8-35            globals_0.14.0         htmlTable_2.2.1        codetools_0.2-18       lubridate_1.7.10       GO.db_3.11.4          
[187] prettyunits_1.1.1      dbplyr_2.1.1           R.methodsS3_1.8.1      gtable_0.3.0           DBI_1.1.1              tensor_1.5            
[193] httr_1.4.2             KernSmooth_2.23-20     stringi_1.7.6          reshape2_1.4.4         farver_2.1.0           viridis_0.6.1         
[199] xml2_1.3.3             rvcheck_0.1.8          scattermore_0.7        bit_4.0.4              scatterpie_0.1.6       jpeg_0.1-8.1          
[205] spatstat.data_2.1-0    ggraph_2.0.5           janitor_2.1.0          pkgconfig_2.0.3        ggprism_1.0.3.9000     rstatix_0.7.0         
[211] knitr_1.37   
samuel-marsh commented 2 years ago

Hi,

Thanks so much! I tried running the same code and I didn't get an error. It's possible that it is due to an older version of ComplexHeatmap being using by you (2.4.3) vs on my machine 2.10.0. I would suggest updating ComplexHeatmap and seeing if that resolves the issue. If not let me know and I'll dig into it more.

Best, Sam

samuel-marsh commented 2 years ago

Hi @Sophia409

Just checking in whether this solved your issue?

Best, Sam

Sophia409 commented 2 years ago

@samuel-marsh

This solved my question, thank you so much!

Best, Sophia

samuel-marsh commented 2 years ago

No problem glad it fixed things!