immunogenomics / symphony

Efficient and precise single-cell reference atlas mapping with Symphony
GNU General Public License v3.0
95 stars 22 forks source link

no slot of name "x" for this object of class "Seurat" #7

Closed Echo226 closed 3 years ago

Echo226 commented 3 years ago

Hi,

Thanks for developing this wonderful tool. I am following the pbmc3k tutorial to Build Symphony Reference, but I got the following error when I run the following code:

vargenes_means_sds$stddev = singlecellmethods::rowSDs(ref_exp, vargenes_means_sds$mean)

Error in rowSDs_dgc(A@x, A@p, A@i, row_means, ncol(A), nrow(A), TRUE) : no slot of name "x" for this object of class "Seurat"

I am also curious what is the "x", "p", "i" slot in your symphony/R/findVariableGenes.R function. Thanks in advance for your reply!

sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.3.so

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

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

other attached packages:
 [1] harmony_1.0             Rcpp_1.0.6              singlecellmethods_0.1.0 data.table_1.14.0       forcats_0.5.1          
 [6] stringr_1.4.0           purrr_0.3.4             readr_1.4.0             tidyr_1.1.3             tibble_3.1.1           
[11] ggplot2_3.3.3           tidyverse_1.3.1         SeuratObject_4.0.0      Seurat_4.0.1            dplyr_1.0.5            
[16] plyr_1.8.6              symphony_1.0            reticulate_1.19        

loaded via a namespace (and not attached):
  [1] readxl_1.3.1          backports_1.2.1       igraph_1.2.6          lazyeval_0.2.2        splines_4.0.0         listenv_0.8.0        
  [7] scattermore_0.7       usethis_2.0.1         digest_0.6.27         htmltools_0.5.1.1     fansi_0.4.2           magrittr_2.0.1       
 [13] memoise_2.0.0         tensor_1.5            cluster_2.1.0         ROCR_1.0-11           remotes_2.2.0         globals_0.14.0       
 [19] modelr_0.1.8          matrixStats_0.58.0    spatstat.sparse_2.0-0 prettyunits_1.1.1     colorspace_2.0-0      rvest_1.0.0          
 [25] ggrepel_0.9.1         haven_2.4.1           xfun_0.22             callr_3.6.0           crayon_1.4.1          jsonlite_1.7.2       
 [31] spatstat.data_2.1-0   survival_3.1-12       zoo_1.8-9             glue_1.4.2            polyclip_1.10-0       gtable_0.3.0         
 [37] leiden_0.3.7          pkgbuild_1.2.0        future.apply_1.7.0    abind_1.4-5           scales_1.1.1          DBI_1.1.1            
 [43] miniUI_0.1.1.1        viridisLite_0.4.0     xtable_1.8-4          spatstat.core_2.1-2   htmlwidgets_1.5.3     httr_1.4.2           
 [49] RColorBrewer_1.1-2    ellipsis_0.3.1        ica_1.0-2             pkgconfig_2.0.3       farver_2.1.0          uwot_0.1.10          
 [55] dbplyr_2.1.1          deldir_0.2-10         utf8_1.2.1            tidyselect_1.1.0      labeling_0.4.2        rlang_0.4.10         
 [61] reshape2_1.4.4        later_1.2.0           munsell_0.5.0         cellranger_1.1.0      tools_4.0.0           cachem_1.0.4         
 [67] cli_2.5.0             generics_0.1.0        devtools_2.3.2        broom_0.7.6           ggridges_0.5.3        evaluate_0.14        
 [73] fastmap_1.1.0         yaml_2.2.1            goftest_1.2-2         processx_3.5.0        knitr_1.31            fs_1.5.0             
 [79] fitdistrplus_1.1-3    RANN_2.6.1            pbapply_1.4-3         future_1.21.0         nlme_3.1-147          mime_0.10            
 [85] ggrastr_0.2.3         xml2_1.3.2            compiler_4.0.0        rstudioapi_0.13       curl_4.3              beeswarm_0.3.1       
 [91] plotly_4.9.3          png_0.1-7             testthat_3.0.2        spatstat.utils_2.1-0  reprex_2.0.0          stringi_1.5.3        
 [97] ps_1.6.0              desc_1.3.0            lattice_0.20-41       Matrix_1.2-18         vctrs_0.3.7           pillar_1.6.0         
[103] lifecycle_1.0.0       spatstat.geom_2.1-0   lmtest_0.9-38         RcppAnnoy_0.0.18      cowplot_1.1.1         irlba_2.3.3          
[109] httpuv_1.6.0          patchwork_1.1.1       R6_2.5.0              promises_1.2.0.1      KernSmooth_2.23-16    gridExtra_2.3        
[115] vipor_0.4.5           parallelly_1.24.0     sessioninfo_1.1.1     codetools_0.2-16      pkgload_1.2.0         MASS_7.3-51.5        
[121] assertthat_0.2.1      rprojroot_2.0.2       withr_2.4.2           sctransform_0.3.2     mgcv_1.8-31           parallel_4.0.0       
[127] hms_1.0.0             grid_4.0.0            rpart_4.1-15          rmarkdown_2.7         Rtsne_0.15            shiny_1.6.0          
[133] lubridate_1.7.10      tinytex_0.31          ggbeeswarm_0.6.0
Echo226 commented 3 years ago

Hi,

I just figured out what's going wrong. In the tutorial, what you used was a "dgcMatrix" object. However, since I had the PBMC dataset as a Seurat object before, I used that Seurat object directly to play with the tutorial, and that's why the error said that there is no "x" slot in the Seurat.

I downloaded the data in data directory and ran the code again, the issue is solved. However I am wondering are you going to implement the Symphony with Seurat in the future?

Thanks!

joycekang commented 3 years ago

Hi, thanks for your message! Glad you were able to figure out the issue. We do plan to integrate Symphony with Seurat in the future - hang tight!

Echo226 commented 3 years ago

Hi joy,

Thanks for your reply. I look forward to it!

Best, Xinting

joycekang commented 3 years ago

Hi Xinting,

Just following up on this - we now have enabled Symphony to work with Seurat objects as a reference (see the Seurat tutorial in the vignettes directory). Note that the Seurat object must have been integrated using Harmony. Thanks!

Joyce