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

How do I remove background from a plot from FeaturePlot function of Seurat 2.3.4 #17

Closed
charlesgwellem opened this issue Sep 24, 2019 · 3 comments

Comments

@charlesgwellem
Copy link

charlesgwellem commented Sep 24, 2019

Hello. I wish to thank you for your work in developing your very efficient and user-friendly package Seurat. To begin I wish to mention that this issue number #1948: Remove background in FeaturePlot has not been able to help me because adding the do.return = TRUE argument does not help the problem.

Inspired by the method in the walk-around function in this post issue #528 , I have successfully plotted the expression of several genes at the same time on my clusters. However I want to remove the default background from the FeaturePlot function by manipulationg the ggplot object that should be returned but I only obtain the same unmodified plot and the value NULL returned when I add additional geom layers.

Seurat::FeaturePlot(object = object, features.plot = "fibrotic.set.score", do.return = T)+ theme_classic()

I get in return the same default plot and NULL returned.

Furthermore, I just noticed that FeaturePlot function in my case returns a list and not a ggplot object.

> class(Seurat::FeaturePlot(nacl_bleo_sub,
+                     features.plot = "fibrotic.set.score",
+                     do.return = T))
[1] "list"

I will be very grateful for any hints to overcome these issues.

session info:

R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

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

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

other attached packages:
 [1] Seurat_2.3.4                DESeq2_1.22.2               forcats_0.4.0               stringr_1.4.0              
 [5] purrr_0.3.2                 readr_1.3.1                 tidyr_0.8.3                 tibble_2.1.3               
 [9] tidyverse_1.2.1             BisqueRNA_1.0               cowplot_1.0.0               SingleCellExperiment_1.4.1 
[13] SummarizedExperiment_1.12.0 DelayedArray_0.8.0          BiocParallel_1.16.6         matrixStats_0.54.0         
[17] GenomicRanges_1.34.0        GenomeInfoDb_1.18.2         IRanges_2.16.0              S4Vectors_0.20.1           
[21] xlsx_0.6.1                  openxlsx_4.1.0.1            dplyr_0.8.3                 cellrangerRkit_1.1.0       
[25] Rmisc_1.5                   plyr_1.8.4                  lattice_0.20-35             bit64_0.9-7                
[29] bit_1.1-14                  ggplot2_3.2.0               RColorBrewer_1.1-2          Biobase_2.42.0             
[33] BiocGenerics_0.28.0         Matrix_1.2-14              

loaded via a namespace (and not attached):
  [1] reticulate_1.13        R.utils_2.9.0          tidyselect_0.2.5       RSQLite_2.1.2          AnnotationDbi_1.44.0  
  [6] htmlwidgets_1.3        grid_3.5.1             Rtsne_0.15             munsell_0.5.0          codetools_0.2-15      
 [11] ica_1.0-2              future_1.14.0          withr_2.1.2            colorspace_1.4-1       knitr_1.23            
 [16] rstudioapi_0.10        ROCR_1.0-7             dtw_1.21-3             robustbase_0.93-5      rJava_0.9-11          
 [21] gbRd_0.4-11            listenv_0.7.0          lars_1.2               Rdpack_0.11-0          labeling_0.3          
 [26] GenomeInfoDbData_1.2.0 pheatmap_1.0.12        rhdf5_2.26.2           vctrs_0.2.0            generics_0.0.2        
 [31] xfun_0.8               diptest_0.75-7         R6_2.4.0               rsvd_1.0.2             locfit_1.5-9.1        
 [36] flexmix_2.3-15         hdf5r_1.2.0            bitops_1.0-6           assertthat_0.2.1       SDMTools_1.1-221.1    
 [41] scales_1.0.0           nnet_7.3-12            gtable_0.3.0           npsurv_0.4-0           globals_0.12.4        
 [46] rlang_0.4.0            zeallot_0.1.0          genefilter_1.64.0      splines_3.5.1          lazyeval_0.2.2        
 [51] acepack_1.4.1          broom_0.5.2            checkmate_1.9.4        BiocManager_1.30.4     yaml_2.2.0            
 [56] reshape2_1.4.3         modelr_0.1.4           backports_1.1.4        Hmisc_4.2-0            tools_3.5.1           
 [61] gplots_3.0.1.1         proxy_0.4-23           ggridges_0.5.1         Rcpp_1.0.2             base64enc_0.1-3       
 [66] zlibbioc_1.28.0        RCurl_1.95-4.12        rpart_4.1-13           pbapply_1.4-1          zoo_1.8-6             
 [71] haven_2.1.1            ggrepel_0.8.1          cluster_2.0.7-1        magrittr_1.5           data.table_1.12.2     
 [76] lmtest_0.9-37          RANN_2.6.1             fitdistrplus_1.0-14    hms_0.5.0              xlsxjars_0.6.1        
 [81] lsei_1.2-0             xtable_1.8-4           XML_3.98-1.20          mclust_5.4.5           readxl_1.3.1          
 [86] gridExtra_2.3          compiler_3.5.1         KernSmooth_2.23-15     crayon_1.3.4           R.oo_1.22.0           
 [91] htmltools_0.3.6        segmented_1.0-0        snow_0.4-3             Formula_1.2-3          geneplotter_1.60.0    
 [96] RcppParallel_4.4.3     lubridate_1.7.4        DBI_1.0.0              fpc_2.2-3              MASS_7.3-50           
[101] cli_1.1.0              R.methodsS3_1.7.1      gdata_2.18.0           metap_1.1              igraph_1.2.4.1        
[106] pkgconfig_2.0.2        foreign_0.8-71         plotly_4.9.0           foreach_1.4.7          xml2_1.2.1            
[111] annotate_1.60.1        XVector_0.22.0         bibtex_0.4.2           rvest_0.3.4            digest_0.6.20         
[116] sctransform_0.2.0      RcppAnnoy_0.0.12       tsne_0.1-3             cellranger_1.1.0       leiden_0.3.1          
[121] htmlTable_1.13.1       uwot_0.1.3             kernlab_0.9-27         modeltools_0.2-22      gtools_3.8.1          
[126] nlme_3.1-137           jsonlite_1.6           Rhdf5lib_1.4.3         viridisLite_0.3.0      pillar_1.4.2          
[131] DEoptimR_1.0-8         httr_1.4.0             survival_2.42-3        glue_1.3.1             zip_2.0.3             
[136] prabclus_2.3-1         iterators_1.0.12       png_0.1-7              mixtools_1.1.0         class_7.3-14          
[141] stringi_1.4.3          blob_1.2.0             doSNOW_1.0.18          latticeExtra_0.6-28    caTools_1.17.1.2      
[146] memoise_1.1.0          irlba_2.3.3            future.apply_1.3.0     ape_5.3 
@mojaveazure
Copy link
Member

This is a question for Seurat, not SeuratWrappers

@MingBit
Copy link

MingBit commented Jun 23, 2020

sorry to bring this up again! I am also having hard time to remove the grey background..
It would be great if you could let me know whether you solved the problem...
thanks :D

@MingBit
Copy link

MingBit commented Jun 23, 2020

hey! I got it.. just add p + theme_set(theme_cowplot()) ..

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

3 participants