carmonalab / ProjecTILs

Interpretation of cell states using reference single-cell maps
GNU General Public License v3.0
234 stars 27 forks source link

An error in initial stages #14

Closed beginner984 closed 2 years ago

beginner984 commented 2 years ago

Sorry I have used mine Seurat object for projection but I get this error

> query.projected <- make.projection(cancer, ref=ref,human.ortho = T)
[1] "Using assay RNA for query"
Pre-filtering of T cells (TILPRED classifier)...
Genes in the gene sets NOT available in the dataset: 
  B.cell:   7 (14% of 50)
CAF:    2 (4% of 49)
Endo.:  5 (11% of 46)
Macrophage:     5 (11% of 46)
Mal:    1 (2% of 45)
[1] "12566 out of 18338 ( 69 % ) non-pure T cells removed.  Use filter.cells=FALSE to avoid pre-filtering (NOT RECOMMENDED)"
[1] "Transforming expression matrix into space of mouse orthologs"
Performing log-normalization
0%   10   20   30   40   50   60   70   80   90   100%
  [----|----|----|----|----|----|----|----|----|----|
     **************************************************|
     [1] "Aligning query to reference map for batch-correction..."
   |========================================================================================================| 100%
   Computing within dataset neighborhoods
   |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=07s  
   Finding all pairwise anchors
   |                                                  | 0 % ~calculating  Finding neighborhoods
   Finding anchors
   Found 616 anchors
   |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=09s  

   Projecting corrected query onto Reference PCA space
   [1] "Projecting corrected query onto Reference UMAP space"
   Warning message:
     In predictTilState(sce, human = human) :
     The following genes were not found in the dataset provided  NAPSB,NCF1C,IGLL5,NCF1B,ELK2AP,CYBASC3,IGJ,WISP2,CTGF,PTRF,CYR61,C10orf10,DARC,FAM26F,GPX1,CTSL1,IL8,SEPP1 . Doesn't look too bad but prediction performance might be affected.
> query.projected
An object of class Seurat 
30365 features across 5772 samples within 2 assays 
Active assay: integrated (707 features, 707 variable features)
 1 other assay present: RNA
 2 dimensional reductions calculated: pca, umap
> cellstate.predict(ref=ref, query=query.projected)
Error: $ operator not defined for this S4 class
> plot.states.radar(ref, query=query.projected, min.cells = 20)
Error in intI(j, n = x@Dim[2], dn[[2]], give.dn = FALSE) : 
  'NA' indices are not (yet?) supported for sparse Matrices
> 
> 

Any help please

mass-a commented 2 years ago

Hello, can you post your sessionInfo()? in particular, which versions of R, Seurat and ProjecTILs are you running?

beginner984 commented 2 years ago

Thank you so much

> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 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

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

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

other attached packages:
 [1] URD_1.1.1                   Matrix_1.3-3                ggplot2_3.3.5              
 [4] SummarizedExperiment_1.20.0 Biobase_2.50.0              MatrixGenerics_1.2.1       
 [7] matrixStats_0.60.0          Signac_1.2.1                GenomicRanges_1.42.0       
[10] GenomeInfoDb_1.26.7         IRanges_2.24.1              S4Vectors_0.28.1           
[13] BiocGenerics_0.36.1        

loaded via a namespace (and not attached):
  [1] SnowballC_0.7.0             scattermore_0.7             ggthemes_4.2.4             
  [4] SeuratObject_4.0.1          tidyr_1.1.3                 bit64_4.0.5                
  [7] irlba_2.3.3                 DelayedArray_0.16.3         data.table_1.14.0          
 [10] rpart_4.1-15                RCurl_1.98-1.3              generics_0.1.0             
 [13] callr_3.7.0                 cowplot_1.1.1               usethis_2.0.1              
 [16] RSQLite_2.2.7               RANN_2.6.1                  proxy_0.4-26               
 [19] future_1.21.0               bit_4.0.4                   spatstat.data_2.1-0        
 [22] httpuv_1.6.1                assertthat_0.2.1            viridis_0.6.1              
 [25] hms_1.1.0                   promises_1.2.0.1            DEoptimR_1.0-9             
 [28] fansi_0.5.0                 caTools_1.18.2              readxl_1.3.1               
 [31] igraph_1.2.6                DBI_1.1.1                   htmlwidgets_1.5.3          
 [34] sparsesvd_0.2               spatstat.geom_2.2-2         purrr_0.3.4                
 [37] ellipsis_0.3.2              RSpectra_0.16-0             dplyr_1.0.7                
 [40] deldir_0.2-10               vctrs_0.3.8                 SingleCellExperiment_1.12.0
 [43] remotes_2.4.0               TTR_0.24.2                  ROCR_1.0-11                
 [46] abind_1.4-5                 cachem_1.0.5                RcppEigen_0.3.3.9.1        
 [49] withr_2.4.2                 ggforce_0.3.3               robustbase_0.93-8          
 [52] vcd_1.4-8                   sctransform_0.3.2           xts_0.12.1                 
 [55] prettyunits_1.1.1           goftest_1.2-2               cluster_2.1.1              
 [58] lazyeval_0.2.2              laeken_0.5.1                crayon_1.4.1               
 [61] labeling_0.4.2              pkgconfig_2.0.3             slam_0.1-48                
 [64] tweenr_1.0.2                nlme_3.1-152                pkgload_1.2.1              
 [67] nnet_7.3-15                 devtools_2.4.2              rlang_0.4.11               
 [70] globals_0.14.0              diptest_0.76-0              lifecycle_1.0.0            
 [73] miniUI_0.1.1.1              cellranger_1.1.0            rprojroot_2.0.2            
 [76] polyclip_1.10-0             RcppHNSW_0.3.0              lmtest_0.9-38              
 [79] ggseqlogo_0.1               carData_3.0-4               boot_1.3-27                
 [82] zoo_1.8-9                   ggridges_0.5.3              processx_3.5.2             
 [85] png_0.1-7                   viridisLite_0.4.0           knn.covertree_1.0          
 [88] bitops_1.0-7                KernSmooth_2.23-18          Biostrings_2.58.0          
 [91] blob_1.2.2                  stringr_1.4.0               parallelly_1.27.0          
 [94] scales_1.1.1                memoise_2.0.0               magrittr_2.0.1             
 [97] plyr_1.8.6                  hexbin_1.28.2               ica_1.0-2                  
[100] gplots_3.1.1                gdata_2.18.0                zlibbioc_1.36.0            
[103] compiler_4.0.5              RColorBrewer_1.1-2          pcaMethods_1.82.0          
[106] fitdistrplus_1.1-5          Rsamtools_2.6.0             cli_3.0.1                  
[109] XVector_0.30.0              listenv_0.8.0               patchwork_1.1.1            
[112] pbapply_1.4-3               ps_1.6.0                    ggplot.multistats_1.0.0    
[115] MASS_7.3-53.1               mgcv_1.8-34                 tidyselect_1.1.1           
[118] stringi_1.6.2               forcats_0.5.1               ggrepel_0.9.1              
[121] grid_4.0.5                  fastmatch_1.1-3             tools_4.0.5                
[124] future.apply_1.7.0          rio_0.5.27                  rstudioapi_0.13            
[127] foreign_0.8-81              lsa_0.73.2                  gridExtra_2.3              
[130] smoother_1.1                scatterplot3d_0.3-41        farver_2.1.0               
[133] Rtsne_0.15                  ggraph_2.0.5                digest_0.6.27              
[136] BiocManager_1.30.15         shiny_1.6.0                 qlcMatrix_0.9.7            
[139] Rcpp_1.0.7                  car_3.0-11                  later_1.2.0                
[142] RcppAnnoy_0.0.19            httr_1.4.2                  AnnotationDbi_1.52.0       
[145] minpack.lm_1.2-1            colorspace_2.0-2            fs_1.5.0                   
[148] tensor_1.5                  ranger_0.13.1               reticulate_1.20            
[151] splines_4.0.5               uwot_0.1.10                 RcppRoll_0.3.0             
[154] spatstat.utils_2.2-0        graphlayouts_0.7.1          sp_1.4-5                   
[157] plotly_4.9.4.1              sessioninfo_1.1.1           xtable_1.8-4               
[160] jsonlite_1.7.2              tidygraph_1.2.0             testthat_3.0.4             
[163] destiny_3.4.0               R6_2.5.0                    gmodels_2.18.1             
[166] pillar_1.6.2                htmltools_0.5.1.1           mime_0.11                  
[169] glue_1.4.2                  fastmap_1.1.0               VIM_6.1.1                  
[172] BiocParallel_1.24.1         class_7.3-19                codetools_0.2-18           
[175] pkgbuild_1.2.0              utf8_1.2.2                  lattice_0.20-41            
[178] spatstat.sparse_2.0-0       tibble_3.1.3                curl_4.3.2                 
[181] leiden_0.3.9                gtools_3.9.2                zip_2.2.0                  
[184] openxlsx_4.2.4              survival_3.2-10             docopt_0.7.1               
[187] desc_1.3.0                  munsell_0.5.0               e1071_1.7-8                
[190] GenomeInfoDbData_1.2.4      haven_2.4.1                 reshape2_1.4.4             
[193] gtable_0.3.0                spatstat.core_2.3-0         Seurat_4.0.1               
> 
mass-a commented 2 years ago

Which version of ProjecTILs? I don't see it in your sessioInfo()...

beginner984 commented 2 years ago

Thank you

ProjecTILs_0.4.1

mass-a commented 2 years ago

Yes, that is an old version, previous to the release of R-4. You should install the latest version of ProjecTILs (1.0.0), hopefully that will solve the incompatibility you are seeing.