satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.29k stars 914 forks source link

Not suitable warning message in v5 #8038

Closed ShixiangWang closed 11 months ago

ShixiangWang commented 11 months ago

I got the following error when I learning the Seurat with doc from https://satijalab.org/seurat/articles/essential_commands

"useNames = NA is deprecated. Instead, specify either useNames = TRUE or useNames = TRUE."

The warning generated from the commands:

pbmc <- SCTransform(object = pbmc)
pbmc <- RunPCA(object = pbmc)
pbmc <- FindNeighbors(object = pbmc, dims = 1:30)
pbmc <- FindClusters(object = pbmc)
pbmc <- RunUMAP(object = pbmc, dims = 1:30)
DimPlot(object = pbmc, reduction = "umap")

Here useNames = TRUE repeats twice. And as a beginner, I don't know why I have to set useNames.

mhkowalski commented 11 months ago

Hi,

Thanks for reporting this. I'm not able to reduce this on my end, could you please share a reproducible example?

ShixiangWang commented 11 months ago

@mhkowalski Thanks for your response. It's strange that I also cannot reproduce it on another Mac. I'm sorry for bothering you.

> library(Seurat)
Loading required package: SeuratObject
Loading required package: sp
The legacy packages maptools, rgdal, and rgeos, underpinning this package
will retire shortly. Please refer to R-spatial evolution reports on
https://r-spatial.org/r/2023/05/15/evolution4.html for details.
This package is now running under evolution status 0 
‘SeuratObject’ was built with package ‘Matrix’ 1.6.2 but the current version is 1.6.3; it is recomended that you reinstall ‘SeuratObject’ as the ABI for
‘Matrix’ may have changed

Attaching package: ‘SeuratObject’

The following object is masked from ‘package:base’:

    intersect

Warning messages:
1: package ‘Seurat’ was built under R version 4.2.3 
2: package ‘SeuratObject’ was built under R version 4.2.3 
> # Load the PBMC dataset
> pbmc.data <- Read10X(data.dir = "~/Downloads/filtered_gene_bc_matrices/hg19/")
> # Initialize the Seurat object with the raw (non-normalized data).
> pbmc <- CreateSeuratObject(counts = pbmc.data, project = "pbmc3k", min.cells = 3, min.features = 200)
Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-')
> pbmc
An object of class Seurat 
13714 features across 2700 samples within 1 assay 
Active assay: RNA (13714 features, 0 variable features)
 1 layer present: counts
> pbmc <- SCTransform(object = pbmc)
Running SCTransform on assay: RNA
Running SCTransform on layer: counts
vst.flavor='v2' set. Using model with fixed slope and excluding poisson genes.
Variance stabilizing transformation of count matrix of size 12572 by 2700
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 2700 cells
Found 70 outliers - those will be ignored in fitting/regularization step

Second step: Get residuals using fitted parameters for 12572 genes
Computing corrected count matrix for 12572 genes
Calculating gene attributes
Wall clock passed: Time difference of 7.689123 secs
Determine variable features
Centering data matrix
  |=======================================================================================================================================================================| 100%
Set default assay to SCT
> pbmc <- RunPCA(object = pbmc)
PC_ 1 
Positive:  MALAT1, RPS27A, LTB, RPS6, RPS27, CCL5, RPL13A, RPS3A, RPL3, RPS3 
       IL32, RPS12, RPL13, RPL21, NKG7, RPS18, RPL9, RPL23A, RPSA, CD3D 
       RPS15A, PTPRCAP, RPLP2, RPL30, CD3E, B2M, LDHB, IL7R, RPL27A, RPL34 
Negative:  FTL, LYZ, FTH1, CST3, S100A9, TYROBP, S100A8, AIF1, LST1, FCN1 
       LGALS1, FCER1G, LGALS2, SAT1, S100A4, CTSS, COTL1, TYMP, S100A6, IFITM3 
       CFD, HLA-DRA, PSAP, S100A11, GPX1, SERPINA1, OAZ1, GSTP1, CD68, NPC2 
PC_ 2 
Positive:  NKG7, CCL5, GZMB, GNLY, GZMA, CST7, PRF1, FGFBP2, CTSW, GZMH 
       CCL4, B2M, SPON2, FCGR3A, CLIC3, CD247, HLA-C, GZMM, HOPX, KLRD1 
       ACTB, XCL2, AKR1C3, IGFBP7, TTC38, HLA-A, APMAP, S1PR5, SRGN, PRSS23 
Negative:  HLA-DRA, CD74, CD79A, HLA-DPB1, HLA-DQA1, HLA-DQB1, TCL1A, CD79B, HLA-DRB1, MS4A1 
       HLA-DPA1, RPL13, RPL13A, LINC00926, LTB, RPL18A, RPL32, HLA-DRB5, RPS18, RPS27 
       VPREB3, RPS2, CD37, HLA-DQA2, RPS6, RPL11, RPS12, RPS23, RPL10, HLA-DMA 
PC_ 3 
Positive:  CD74, HLA-DRA, CD79A, HLA-DPB1, HLA-DQA1, HLA-DRB1, CD79B, HLA-DPA1, HLA-DQB1, TCL1A 
       MS4A1, NKG7, HLA-DRB5, GZMB, LINC00926, GNLY, HLA-DQA2, VPREB3, FGFBP2, PRF1 
       HLA-DMA, CST7, FCER2, CD37, GZMA, BANK1, HLA-DMB, GZMH, HVCN1, CCL5 
Negative:  S100A8, S100A9, LYZ, FTL, JUNB, RPS12, LDHB, IL7R, CD3D, RPS14 
       RPS3, RPS6, CD3E, RPL32, RPL13, NOSIP, IL32, S100A4, TPT1, S100A6 
       VIM, RPL10, RPL3, FOS, RPLP1, RPL11, LEF1, FCN1, RGCC, RPS18 
PC_ 4 
Positive:  S100A8, S100A9, LYZ, LGALS2, CD14, GPX1, GSTP1, NKG7, MS4A6A, FCN1 
       CCL3, S100A12, FOLR3, CEBPD, GNLY, GRN, CSF3R, GZMB, RBP7, GAPDH 
       BLVRB, CCL5, IL8, VCAN, ID1, CST7, ALDH2, FGFBP2, NCF1, GZMA 
Negative:  FCGR3A, LST1, FCER1G, AIF1, IFITM3, MS4A7, IFITM2, FTH1, COTL1, RHOC 
       RP11-290F20.3, TIMP1, SAT1, HES4, CDKN1C, SERPINA1, CEBPB, CKB, RPS19, LRRC25 
       LILRA3, HMOX1, SIGLEC10, HCK, SPI1, PILRA, STXBP2, ACTB, WARS, BID 
PC_ 5 
Positive:  CCL5, GPX1, PPBP, PF4, SDPR, SPARC, GNG11, HIST1H2AC, CD9, TPM4 
       CLU, NRGN, TUBB1, GP9, TAGLN2, RGS18, RUFY1, MPP1, ACTB, TUBA4A 
       CA2, NCOA4, GRAP2, CTSA, PTCRA, TREML1, NGFRAP1, PGRMC1, FERMT3, RGS10 
Negative:  GNLY, GZMB, FGFBP2, FCGR3A, PRF1, NKG7, TYROBP, FCER1G, MALAT1, LST1 
       SPON2, IFITM3, AIF1, RPS6, FTL, RPL10, RPS19, RPS3A, CCL4, RPL13 
       RPL32, IFITM2, IGFBP7, CTSW, RPL21, CLIC3, RPL19, CD247, RPL11, KLRD1 
> pbmc <- FindNeighbors(object = pbmc, dims = 1:30)
Computing nearest neighbor graph
Computing SNN
> pbmc <- FindClusters(object = pbmc)
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 2700
Number of edges: 109691

Running Louvain algorithm...
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.8384
Number of communities: 13
Elapsed time: 0 seconds
> pbmc <- RunUMAP(object = pbmc, dims = 1:30)
Warning: The default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using the cosine metric
To use Python UMAP via reticulate, set umap.method to 'umap-learn' and metric to 'correlation'
This message will be shown once per session
10:15:50 UMAP embedding parameters a = 0.9922 b = 1.112
Found more than one class "dist" in cache; using the first, from namespace 'spam'
Also defined by ‘BiocGenerics’
10:15:51 Read 2700 rows and found 30 numeric columns
10:15:51 Using Annoy for neighbor search, n_neighbors = 30
Found more than one class "dist" in cache; using the first, from namespace 'spam'
Also defined by ‘BiocGenerics’
10:15:51 Building Annoy index with metric = cosine, n_trees = 50
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
10:15:51 Writing NN index file to temp file /var/folders/gm/lw6z28md2594gcnws_38_9f40000gn/T//Rtmp9WkNHQ/file286d5085d604
10:15:51 Searching Annoy index using 1 thread, search_k = 3000
10:15:51 Annoy recall = 100%
10:15:51 Commencing smooth kNN distance calibration using 1 thread with target n_neighbors = 30
10:15:52 Initializing from normalized Laplacian + noise (using RSpectra)
10:15:52 Commencing optimization for 500 epochs, with 112294 positive edges
Using method 'umap'
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
10:15:55 Optimization finished
> DimPlot(object = pbmc, reduction = "umap")
> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS 14.1.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] Seurat_5.0.0       SeuratObject_5.0.0 sp_1.6-1          

loaded via a namespace (and not attached):
  [1] Rtsne_0.16                  colorspace_2.1-0            deldir_1.0-9                ellipsis_0.3.2              ggridges_0.5.4              XVector_0.38.0             
  [7] GenomicRanges_1.50.2        RcppHNSW_0.5.0              rstudioapi_0.14             spatstat.data_3.0-1         farver_2.1.1                leiden_0.4.3               
 [13] listenv_0.9.0               ggrepel_0.9.3               RSpectra_0.16-1             fansi_1.0.4                 sparseMatrixStats_1.10.0    codetools_0.2-19           
 [19] splines_4.2.2               R.methodsS3_1.8.2           polyclip_1.10-4             spam_2.10-0                 jsonlite_1.8.4              ica_1.0-3                  
 [25] cluster_2.1.4               png_0.1-8                   R.oo_1.25.0                 uwot_0.1.14                 shiny_1.7.4                 sctransform_0.4.1          
 [31] spatstat.sparse_3.0-1       compiler_4.2.2              httr_1.4.6                  Matrix_1.6-3                fastmap_1.1.1               lazyeval_0.2.2             
 [37] cli_3.6.1                   later_1.3.1                 htmltools_0.5.5             tools_4.2.2                 igraph_1.4.3                dotCall64_1.1-0            
 [43] GenomeInfoDbData_1.2.9      gtable_0.3.3                glue_1.6.2                  RANN_2.6.1                  reshape2_1.4.4              dplyr_1.1.2                
 [49] Rcpp_1.0.10                 Biobase_2.58.0              scattermore_1.2             vctrs_0.6.2                 spatstat.explore_3.2-1      nlme_3.1-162               
 [55] progressr_0.13.0            DelayedMatrixStats_1.20.0   lmtest_0.9-40               spatstat.random_3.1-5       stringr_1.5.0               globals_0.16.2             
 [61] mime_0.12                   miniUI_0.1.1.1              lifecycle_1.0.3             irlba_2.3.5.1               goftest_1.2-3               future_1.32.0              
 [67] zlibbioc_1.44.0             MASS_7.3-60                 zoo_1.8-12                  scales_1.2.1                MatrixGenerics_1.10.0       promises_1.2.0.1           
 [73] spatstat.utils_3.0-3        SummarizedExperiment_1.28.0 parallel_4.2.2              RColorBrewer_1.1-3          reticulate_1.28             pbapply_1.7-0              
 [79] gridExtra_2.3               ggplot2_3.4.2               stringi_1.7.12              S4Vectors_0.36.2            fastDummies_1.7.3           BiocGenerics_0.44.0        
 [85] GenomeInfoDb_1.34.9         bitops_1.0-7                rlang_1.1.1                 pkgconfig_2.0.3             matrixStats_0.63.0          glmGamPoi_1.10.2           
 [91] lattice_0.21-8              ROCR_1.0-11                 purrr_1.0.1                 tensor_1.5                  labeling_0.4.2              patchwork_1.1.2            
 [97] htmlwidgets_1.6.2           cowplot_1.1.1               tidyselect_1.2.0            parallelly_1.36.0           RcppAnnoy_0.0.20            plyr_1.8.8                 
[103] magrittr_2.0.3              R6_2.5.1                    IRanges_2.32.0              generics_0.1.3              DelayedArray_0.24.0         withr_2.5.0                
[109] pillar_1.9.0                fitdistrplus_1.1-11         RCurl_1.98-1.12             survival_3.5-5              abind_1.4-5                 tibble_3.2.1               
[115] future.apply_1.11.0         KernSmooth_2.23-21          utf8_1.2.3                  spatstat.geom_3.2-1         plotly_4.10.1               grid_4.2.2                 
[121] data.table_1.14.8           digest_0.6.31               xtable_1.8-4                tidyr_1.3.0                 httpuv_1.6.11               R.utils_2.12.2             
[127] stats4_4.2.2                munsell_0.5.0               viridisLite_0.4.2