junjunlab / scRNAtoolVis

Useful functions to make your scRNA-seq plot more cool!
Other
271 stars 29 forks source link

Error occurred in the 6th layer. Caused by error in `check_aesthetics()` #23

Open Dana11T opened 1 year ago

Dana11T commented 1 year ago

jjVolcano(diffData = pbmc.markers) I ran this but got an error. I checked my pbmc.markers 。 The error reads as follows This palatte have 12 colors! Scale for y is already present. Adding another scale for y, which will replace the existing scale. Error in ggplot2::geom_text(): ! Problem while setting up geom aesthetics. ℹ Error occurred in the 6th layer. Caused by error in check_aesthetics(): ! Aesthetics must be either length 1 or the same as the data (6848) ✖ Fix the following mappings: size Run rlang::last_trace() to see where the error occurred. rlang::last_trace() <error/rlang_error> Error in ggplot2::geom_text(): ! Problem while setting up geom aesthetics. ℹ Error occurred in the 6th layer. Caused by error in check_aesthetics(): ! Aesthetics must be either length 1 or the same as the data (11483) ✖ Fix the following mappings: size

Backtrace: ▆

  1. ├─base (local) <fn>(x)
  2. └─ggplot2:::print.ggplot(x)
  3. ├─ggplot2::ggplot_build(x)
  4. └─ggplot2:::ggplot_build.ggplot(x)
  5. └─ggplot2:::by_layer(...)
  6. ├─rlang::try_fetch(...)
  7. │ ├─base::tryCatch(...)
  8. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9. │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
    1. │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
    2. │ └─base::withCallingHandlers(...)
    3. └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
    4. └─l$compute_geom_2(d)
    5. └─ggplot2 (local) compute_geom_2(..., self = self)
    6. └─self$geom$use_defaults(data, self$aes_params, modifiers)
    7. └─ggplot2 (local) use_defaults(..., self = self)
    8. └─ggplot2:::check_aesthetics(params[aes_params], nrow(data))
junjunlab commented 1 year ago

try re-install scRNAtoolVis.

SuperSe7enF commented 1 year ago

Have you solved your problem? @Dana11T I also have the same problem, and I did not solve the problem after re-install scRNAtoolVis.

sessionInfo() R version 4.3.0 (2023-04-21) 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/openblas/libblas.so.3 LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so; LAPACK version 3.7.1

locale: [1] LC_CTYPE=zh_CN.UTF-8 LC_NUMERIC=C LC_TIME=zh_CN.UTF-8
[4] LC_COLLATE=zh_CN.UTF-8 LC_MONETARY=zh_CN.UTF-8 LC_MESSAGES=zh_CN.UTF-8
[7] LC_PAPER=zh_CN.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=C

time zone: Asia/Shanghai tzcode source: system (glibc)

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

other attached packages: [1] ggunchull_0.1.0 scRNAtoolVis_0.0.6 org.Hs.eg.db_3.17.0
[4] AnnotationDbi_1.62.1 ClusterGVis_0.1.0 monocle_2.28.0
[7] DDRTree_0.1.5 irlba_2.3.5.1 VGAM_1.1-8
[10] Matrix_1.5-4.1 philentropy_0.7.0 plyr_1.8.8
[13] pbapply_1.7-0 tidygraph_1.2.3 limma_3.56.2
[16] RColorBrewer_1.1-3 lubridate_1.9.2 forcats_1.0.0
[19] purrr_1.0.1 tibble_3.2.1 tidyverse_2.0.0
[22] scuttle_1.10.1 ComplexHeatmap_2.16.0 SCopeLoomR_0.13.0
[25] doParallel_1.0.17 iterators_1.0.14 foreach_1.5.2
[28] ggraph_2.1.0 AUCell_1.22.0 RcisTarget_1.20.0
[31] SCENIC_1.3.1 arrow_12.0.1 ggsci_3.0.0
[34] shiny_1.7.4 tidyselect_1.2.0 monocle3_1.3.1
[37] SingleCellExperiment_1.22.0 SummarizedExperiment_1.30.2 GenomicRanges_1.52.0
[40] GenomeInfoDb_1.36.0 IRanges_2.34.0 S4Vectors_0.38.1
[43] MatrixGenerics_1.12.2 matrixStats_1.0.0 Biobase_2.60.0
[46] BiocGenerics_0.46.0 ggpubr_0.6.0 reshape2_1.4.4
[49] tidyr_1.3.0 dplyr_1.1.2 COSG_0.9.0
[52] paletteer_1.5.0 Nebulosa_1.10.0 patchwork_1.1.2
[55] stringr_1.5.0 ggplot2_3.4.2 cowplot_1.1.1
[58] SeuratObject_4.1.3 Seurat_4.3.0 qs_0.25.5
[61] data.table_1.14.8 readr_2.1.4

loaded via a namespace (and not attached): [1] R.methodsS3_1.8.2 GSEABase_1.62.0 urlchecker_1.0.1
[4] goftest_1.2-3 DT_0.28 Biostrings_2.68.1
[7] vctrs_0.6.3 spatstat.random_3.1-5 RApiSerialize_0.1.2
[10] digest_0.6.31 png_0.1-8 shape_1.4.6
[13] ggrepel_0.9.3 org.Mm.eg.db_3.17.0 deldir_1.0-9
[16] parallelly_1.36.0 ggheatmap_2.11 combinat_0.0-8
[19] MASS_7.3-59 httpuv_1.6.11 qvalue_2.32.0
[22] withr_2.5.0 ggfun_0.1.0 ellipsis_0.3.2
[25] survival_3.5-5 memoise_2.0.1 qlcMatrix_0.9.7
[28] profvis_0.3.8 docopt_0.7.1 tidytree_0.4.2
[31] zoo_1.8-12 GlobalOptions_0.1.2 R.oo_1.25.0
[34] prettyunits_1.1.1 rematch2_2.1.2 KEGGREST_1.40.0
[37] promises_1.2.0.1 httr_1.4.6 rstatix_0.7.2
[40] globals_0.16.2 fitdistrplus_1.1-11 ps_1.7.5
[43] stringfish_0.15.8 rstudioapi_0.14 miniUI_0.1.1.1
[46] generics_0.1.3 DOSE_3.26.1 sparsesvd_0.2-2
[49] processx_3.8.1 zlibbioc_1.46.0 polyclip_1.10-4
[52] GenomeInfoDbData_1.2.10 xtable_1.8-4 pracma_2.4.2
[55] S4Arrays_1.0.4 hms_1.1.3 colorspace_2.1-0
[58] hdf5r_1.3.8 ROCR_1.0-11 reticulate_1.30
[61] spatstat.data_3.0-1 magrittr_2.0.3 lmtest_0.9-40
[64] later_1.3.1 viridis_0.6.3 ggtree_3.8.0
[67] lattice_0.21-8 spatstat.geom_3.2-1 future.apply_1.11.0
[70] scattermore_1.2 XML_3.99-0.14 RcppAnnoy_0.0.20
[73] pillar_1.9.0 nlme_3.1-162 compiler_4.3.0
[76] beachmat_2.16.0 stringi_1.7.12 tensor_1.5
[79] minqa_1.2.5 dendextend_1.17.1 devtools_2.4.5
[82] crayon_1.5.2 abind_1.4-5 ggdendro_0.1.23
[85] gridGraphics_0.5-1 sp_1.6-1 graphlayouts_1.0.0
[88] bit_4.0.5 terra_1.7-39 UpSetR_1.4.0
[91] fastmatch_1.1-3 codetools_0.2-19 slam_0.1-50
[94] GetoptLong_1.0.5 plotly_4.10.2 leidenbase_0.1.9
[97] mime_0.12 circlize_0.4.15 Rcpp_1.0.10
[100] sparseMatrixStats_1.12.0 HDO.db_0.99.1 blob_1.2.4
[103] utf8_1.2.3 clue_0.3-64 lme4_1.1-33
[106] fs_1.6.2 listenv_0.9.0 DelayedMatrixStats_1.22.1 [109] pkgbuild_1.4.1 ggsignif_0.6.4 ggplotify_0.1.0
[112] callr_3.7.3 tzdb_0.4.0 tweenr_2.0.2
[115] pkgconfig_2.0.3 pheatmap_1.0.12 tools_4.3.0
[118] cachem_1.0.8 RSQLite_2.3.1 viridisLite_0.4.2
[121] DBI_1.1.3 fastmap_1.1.1 scales_1.2.1
[124] usethis_2.2.1 ica_1.0-3 broom_1.0.5
[127] graph_1.78.0 carData_3.0-5 RANN_2.6.1
[130] farver_2.1.1 cli_3.6.1 leiden_0.4.3
[133] lifecycle_1.0.3 uwot_0.1.14 mvtnorm_1.2-2
[136] sessioninfo_1.2.2 backports_1.4.1 BiocParallel_1.34.2
[139] annotate_1.78.0 timechange_0.2.0 gtable_0.3.3
[142] rjson_0.2.21 ggridges_0.5.4 progressr_0.13.0
[145] ape_5.7-1 jsonlite_1.8.5 bitops_1.0-7
[148] bit64_4.0.5 assertthat_0.2.1 Rtsne_0.16
[151] yulab.utils_0.0.6 spatstat.utils_3.0-3 RcppParallel_5.1.7
[154] GOSemSim_2.26.0 R.utils_2.12.2 jjAnno_0.0.3
[157] lazyeval_0.2.2 htmltools_0.5.5 GO.db_3.17.0
[160] sctransform_0.3.5 glue_1.6.2 XVector_0.40.0
[163] RCurl_1.98-1.12 treeio_1.24.1 mclust_6.0.0
[166] ks_1.14.0 gridExtra_2.3 boot_1.3-28
[169] igraph_1.5.0 R6_2.5.1 labeling_0.4.2
[172] HSMMSingleCell_1.20.0 cluster_2.1.4 pkgload_1.3.2
[175] aplot_0.1.10 nloptr_2.0.3 DelayedArray_0.26.3
[178] ggforce_0.4.1 car_3.1-2 future_1.32.0
[181] fastICA_1.2-3 munsell_0.5.0 KernSmooth_2.23-20
[184] htmlwidgets_1.6.2 fgsea_1.26.0 rlang_1.1.1
[187] spatstat.sparse_3.0-1 spatstat.explore_3.2-1 remotes_2.4.2
[190] fansi_1.0.4

SuperSe7enF commented 1 year ago

When I assign X value to function cluster_size, the problem is solved. For example, jjVolcano(diffData = pbmc.markers, cluster_size = 5) But I don't know how to solve the problem and modify the code of the original function. Thanks!

SuperSe7enF commented 1 year ago

The issue has been resolved after re-install scRNAtoolVis. Thanks!

hyq9588 commented 1 year ago

jjVolcano(diffData = pbmc.markers) I ran this but got an error. I checked my pbmc.markers 。 The error reads as follows

This palatte have 12 colors! Scale for y is already present. Adding another scale for y, which will replace the existing scale. Error in ggplot2::geom_text(): ! Problem while setting up geom aesthetics. ℹ Error occurred in the 6th layer. Caused by error in check_aesthetics(): ! Aesthetics must be either length 1 or the same as the data (6848) ✖ Fix the following mappings: size Run rlang::last_trace() to see where the error occurred. rlang::last_trace() <error/rlang_error> Error in ggplot2::geom_text(): ! Problem while setting up geom aesthetics. ℹ Error occurred in the 6th layer. Caused by error in check_aesthetics(): ! Aesthetics must be either length 1 or the same as the data (11483) ✖ Fix the following mappings: size Backtrace: ▆

  1. ├─base (local) <fn>(x)
  2. └─ggplot2:::print.ggplot(x)
  3. ├─ggplot2::ggplot_build(x)
  4. └─ggplot2:::ggplot_build.ggplot(x)
  5. └─ggplot2:::by_layer(...)
  6.  ├─rlang::try_fetch(...)
  7.  │ ├─base::tryCatch(...)
  8.  │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9.  │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  10.   │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
  11.   │ └─base::withCallingHandlers(...)
  12.   └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
  13.     └─l$compute_geom_2(d)
  14.       └─ggplot2 (local) compute_geom_2(..., self = self)
  15.         └─self$geom$use_defaults(data, self$aes_params, modifiers)
  16.           └─ggplot2 (local) use_defaults(..., self = self)
  17.             └─ggplot2:::check_aesthetics(params[aes_params], nrow(data))

I meet the same problem. By set the parameter 'cluster_size = 5'(the number is your celltype), the problem has been solved.