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

only one scale legend appears when splited by condition #5466

Closed
dahun73 opened this issue Jan 10, 2022 · 2 comments
Closed

only one scale legend appears when splited by condition #5466

dahun73 opened this issue Jan 10, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@dahun73
Copy link

dahun73 commented Jan 10, 2022

Hello everyone :)

I have a question about showing feature plot.
When I use 'split.by' parameter, only one scale legend is shown like this.
image

I want to show scale legend with all genes. How can I fix it?

Thank you in advance!

Dahun

pdf("Featureplot_inte.combined_list_split_cluster_220110.pdf",height =20,width = 10)
FeaturePlot(inte.combined.1,features = c("Eomes","Pax6","Tbr1","Sox2","Tubb3","Rbfox3","Bcl11b","Cux1"),split.by = "stim",reduction = 'umap',keep.scale = 'all',label = "TRUE")+theme(legend.position = "right")
dev.off()
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 21.10

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

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

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

other attached packages:
 [1] ggrepel_0.9.1               ggfortify_0.4.13            SCINA_1.2.0                
 [4] gplots_3.1.1                MASS_7.3-54                 metap_1.5                  
 [7] multtest_2.48.0             SeuratObject_4.0.2          Seurat_4.0.5               
[10] devtools_2.4.2              usethis_2.1.3               scRNAseq_2.6.1             
[13] RColorBrewer_1.1-2          pheatmap_1.0.12             SingleR_1.6.1              
[16] celldex_1.2.0               SingleCellExperiment_1.14.1 SummarizedExperiment_1.22.0
[19] Biobase_2.52.0              GenomicRanges_1.44.0        GenomeInfoDb_1.28.4        
[22] IRanges_2.26.0              S4Vectors_0.30.2            BiocGenerics_0.38.0        
[25] MatrixGenerics_1.4.3        matrixStats_0.61.0          ggpubr_0.4.0               
[28] ggsignif_0.6.3              ggplot2_3.3.5               cowplot_1.1.1              
[31] patchwork_1.1.1             dplyr_1.0.7                

loaded via a namespace (and not attached):
  [1] rappdirs_0.3.3                rtracklayer_1.52.1            scattermore_0.7              
  [4] tidyr_1.1.4                   bit64_4.0.5                   multcomp_1.4-17              
  [7] irlba_2.3.3                   DelayedArray_0.18.0           rpart_4.1-15                 
 [10] data.table_1.14.2             KEGGREST_1.32.0               RCurl_1.98-1.5               
 [13] AnnotationFilter_1.16.0       generics_0.1.1                GenomicFeatures_1.44.2       
 [16] ScaledMatrix_1.0.0            TH.data_1.1-0                 callr_3.7.0                  
 [19] RSQLite_2.2.8                 RANN_2.6.1                    future_1.23.0                
 [22] bit_4.0.4                     mutoss_0.1-12                 spatstat.data_2.1-0          
 [25] xml2_1.3.2                    httpuv_1.6.3                  assertthat_0.2.1             
 [28] xfun_0.27                     hms_1.1.1                     promises_1.2.0.1             
 [31] fansi_0.5.0                   restfulr_0.0.13               progress_1.2.2               
 [34] caTools_1.18.2                dbplyr_2.1.1                  readxl_1.3.1                 
 [37] tmvnsim_1.0-2                 igraph_1.2.7                  DBI_1.1.1                    
 [40] htmlwidgets_1.5.4             spatstat.geom_2.3-0           purrr_0.3.4                  
 [43] ellipsis_0.3.2                backports_1.3.0               biomaRt_2.48.3               
 [46] deldir_1.0-6                  sparseMatrixStats_1.4.2       vctrs_0.3.8                  
 [49] remotes_2.4.1                 ensembldb_2.16.4              ROCR_1.0-11                  
 [52] abind_1.4-5                   cachem_1.0.6                  withr_2.4.2                  
 [55] sctransform_0.3.2             GenomicAlignments_1.28.0      prettyunits_1.1.1            
 [58] mnormt_2.0.2                  goftest_1.2-3                 cluster_2.1.2                
 [61] ExperimentHub_2.0.0           lazyeval_0.2.2                crayon_1.4.2                 
 [64] labeling_0.4.2                pkgconfig_2.0.3               nlme_3.1-153                 
 [67] pkgload_1.2.3                 ProtGenerics_1.24.0           rlang_0.4.12                 
 [70] globals_0.14.0                lifecycle_1.0.1               miniUI_0.1.1.1               
 [73] sandwich_3.0-1                filelock_1.0.2                BiocFileCache_2.0.0          
 [76] mathjaxr_1.4-0                rsvd_1.0.5                    AnnotationHub_3.0.2          
 [79] cellranger_1.1.0              rprojroot_2.0.2               polyclip_1.10-0              
 [82] lmtest_0.9-38                 Matrix_1.4-0                  carData_3.0-4                
 [85] zoo_1.8-9                     ggridges_0.5.3                processx_3.5.2               
 [88] png_0.1-7                     viridisLite_0.4.0             rjson_0.2.20                 
 [91] bitops_1.0-7                  KernSmooth_2.23-20            Biostrings_2.60.2            
 [94] blob_1.2.2                    DelayedMatrixStats_1.14.3     stringr_1.4.0                
 [97] parallelly_1.28.1             rstatix_0.7.0                 beachmat_2.8.1               
[100] scales_1.1.1                  memoise_2.0.0                 magrittr_2.0.1               
[103] plyr_1.8.6                    ica_1.0-2                     zlibbioc_1.38.0              
[106] compiler_4.1.2                tinytex_0.34                  BiocIO_1.2.0                 
[109] plotrix_3.8-2                 fitdistrplus_1.1-6            Rsamtools_2.8.0              
[112] cli_3.1.0                     XVector_0.32.0                listenv_0.8.0                
[115] pbapply_1.5-0                 ps_1.6.0                      mgcv_1.8-38                  
[118] tidyselect_1.1.1              stringi_1.7.5                 forcats_0.5.1                
[121] yaml_2.2.1                    BiocSingular_1.8.1            grid_4.1.2                   
[124] tools_4.1.2                   future.apply_1.8.1            rio_0.5.27                   
[127] rstudioapi_0.13               foreign_0.8-81                gridExtra_2.3                
[130] farver_2.1.0                  Rtsne_0.15                    digest_0.6.28                
[133] BiocManager_1.30.16           shiny_1.7.1                   Rcpp_1.0.7                   
[136] car_3.0-11                    broom_0.7.10                  BiocVersion_3.13.1           
[139] later_1.3.0                   RcppAnnoy_0.0.19              httr_1.4.2                   
[142] AnnotationDbi_1.54.1          Rdpack_2.1.2                  colorspace_2.0-2             
[145] XML_3.99-0.8                  fs_1.5.0                      tensor_1.5                   
[148] reticulate_1.22               splines_4.1.2                 uwot_0.1.10                  
[151] sn_2.0.0                      spatstat.utils_2.2-0          plotly_4.10.0                
[154] sessioninfo_1.2.0             xtable_1.8-4                  jsonlite_1.7.2               
[157] testthat_3.1.0                R6_2.5.1                      TFisher_0.2.0                
[160] pillar_1.6.4                  htmltools_0.5.2               mime_0.12                    
[163] glue_1.5.0                    fastmap_1.1.0                 BiocParallel_1.26.2          
[166] BiocNeighbors_1.10.0          interactiveDisplayBase_1.30.0 codetools_0.2-18             
[169] mvtnorm_1.1-3                 pkgbuild_1.2.0                utf8_1.2.2                   
[172] lattice_0.20-45               spatstat.sparse_2.0-0         tibble_3.1.6                 
[175] numDeriv_2016.8-1.1           curl_4.3.2                    leiden_0.3.9                 
[178] gtools_3.9.2                  zip_2.2.0                     openxlsx_4.2.4               
[181] survival_3.2-13               desc_1.4.0                    munsell_0.5.0                
[184] GenomeInfoDbData_1.2.6        haven_2.4.3                   reshape2_1.4.4               
[187] gtable_0.3.0                  rbibutils_2.2.4               spatstat.core_2.3-0
@dahun73 dahun73 added the bug Something isn't working label Jan 10, 2022
@samuel-marsh
Copy link
Collaborator

Hi,

Not member of dev team but hopefully can be helpful. This is because layout plots use the patchwork package. To add legend simply use FeaturePlot(...) & theme(legend.position = "right") to show all legends.

Also as FYI currently in Seurat there is bug with displaying the plots using the same scale when using split.by. If you want to display all plots split.by you can use FeaturePlot_scCustom from the scCustomize package. See #5243 (comment) for more info.

Best,
Sam

@dahun73
Copy link
Author

dahun73 commented Jan 11, 2022

Hi,

Not member of dev team but hopefully can be helpful. This is because layout plots use the patchwork package. To add legend simply use FeaturePlot(...) & theme(legend.position = "right") to show all legends.

Also as FYI currently in Seurat there is bug with displaying the plots using the same scale when using split.by. If you want to display all plots split.by you can use FeaturePlot_scCustom from the scCustomize package. See #5243 (comment) for more info.

Best, Sam

Dear Sam,

Thank you so much.

Because I used '+ theme', only last one have scale legend.
Have a good day! :)

Dahun

@dahun73 dahun73 closed this as completed Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants