sqjin / CellChat

R toolkit for inference, visualization and analysis of cell-cell communication from single-cell data
GNU General Public License v3.0
627 stars 142 forks source link

netAnalysis_river doesn't show alluvial plots #549

Open cwibrand opened 1 year ago

cwibrand commented 1 year ago

Hi!

Thank you for a great package! I'm trying to create alluvial plots. I've had no trouble thus far with any of the other functions. However, for the netAnalysis_river the code runs without any errors, but it shows no plot, just the labels. Do you know what might be wrong? Thanks!

k <- selectK(cellchat_objects[[1]], pattern = 'outgoing', k.range = seq(1,10)) cellchat_objects[[1]] <- identifyCommunicationPatterns(cellchat_objects[[1]], pattern = "outgoing", k = 3, width = 10, height = 20) netAnalysis_river(cellchat_objects[[1]], pattern = "outgoing", cutoff = 0.5, do.order = TRUE)

Screen Shot 2023-02-13 at 12 51 33 PM

R version 4.2.2 Patched (2022-11-10 r83330) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 18.04.6 LTS

Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale: [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8
[6] LC_MESSAGES=C.UTF-8 LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C

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

other attached packages: [1] doParallel_1.0.16 iterators_1.0.13 foreach_1.5.1 ggalluvial_0.12.3 NMF_0.23.0 cluster_2.1.4
[7] rngtools_1.5 pkgmaker_0.31.1 registry_0.5-1 CellChat_1.6.0 Biobase_2.58.0 BiocGenerics_0.44.0 [13] ggplot2_3.4.0 igraph_1.3.5 dplyr_1.1.0 circlize_0.4.16

loaded via a namespace (and not attached): [1] colorspace_2.1-0 ggsignif_0.6.0 rjson_0.2.20 rio_0.5.16 GlobalOptions_0.1.2 [6] BiocNeighbors_1.16.0 clue_0.3-57 rstudioapi_0.11 ggpubr_0.4.0 listenv_0.9.0
[11] farver_2.1.1 ggrepel_0.9.3 RSpectra_0.16-0 fansi_1.0.4 codetools_0.2-16
[16] jsonlite_1.8.4 broom_0.7.1 gridBase_0.4-7 png_0.1-8 compiler_4.2.2
[21] backports_1.1.10 assertthat_0.2.1 Matrix_1.5-3 cli_3.6.0 tools_4.2.2
[26] coda_0.19-4 gtable_0.3.1 glue_1.6.2 reshape2_1.4.4 Rcpp_1.0.10
[31] carData_3.0-4 cellranger_1.1.0 statnet.common_4.7.0 vctrs_0.5.2 svglite_2.1.0
[36] stringr_1.5.0 globals_0.16.2 network_1.18.0 openxlsx_4.2.2 lifecycle_1.0.3
[41] irlba_2.3.5.1 rstatix_0.6.0 future_1.31.0 scales_1.2.1 hms_0.5.3
[46] RColorBrewer_1.1-3 ComplexHeatmap_2.4.3 curl_5.0.0 reticulate_1.28 pbapply_1.7-0
[51] ggnetwork_0.5.10 stringi_1.7.12 S4Vectors_0.36.1 zip_2.1.1 BiocParallel_1.32.5 [56] bibtex_0.4.2.3 shape_1.4.6 rlang_1.0.6 pkgconfig_2.0.3 systemfonts_1.0.4
[61] lattice_0.20-41 purrr_1.0.1 patchwork_1.1.2 labeling_0.4.2 cowplot_1.1.1
[66] tidyselect_1.2.0 parallelly_1.34.0 plyr_1.8.8 magrittr_2.0.3 R6_2.5.1
[71] IRanges_2.32.0 generics_0.1.3 sna_2.7 DBI_1.1.3 pillar_1.8.1
[76] haven_2.3.1 foreign_0.8-82 withr_2.5.0 abind_1.4-5 tibble_3.1.8
[81] future.apply_1.10.0 crayon_1.5.2 car_3.0-10 utf8_1.2.3 GetoptLong_1.0.3
[86] grid_4.2.2 readxl_1.3.1 data.table_1.14.6 FNN_1.1.3.1 forcats_0.5.0
[91] digest_0.6.31 xtable_1.8-4 tidyr_1.3.0 stats4_4.2.2 munsell_0.5.0

sqjin commented 1 year ago

@cwibrand Can you add par(mfrow=c(1,1)) before running this function? Otherwise, I have no idea on this.

yanpinlu commented 1 year ago

I found that my problem was due to the '0.12.3' version of the ggalluvial package downloaded earlier, which was prompted to be introduced by ggplot2. After I re-upgraded the ggalluvial package to version '0.12.4' and again library(CellChat),library(ggalluvial) can be plotted normally