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

Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE. #256

Closed
LeaLe88 opened this issue Dec 12, 2023 · 5 comments

Comments

@LeaLe88
Copy link

LeaLe88 commented Dec 12, 2023

Dear all,

Suddenly I am getting the following error:
Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.

when running the SingleR with


pred_combined <- SingleR(test = pbmc_counts_combined,
        ref = ref, 
        labels = ref$label.main,clusters=kid.filtered_new$seurat_clusters)

I did not get this error before. I have been installing some new packages today / updates. What can I do now?

Thank you very much!

@PeteHaitch
Copy link
Contributor

PeteHaitch commented Dec 12, 2023

Please provide a reproducible example (as text and not as a screenshot).
E.g., this demonstrates SingleR() working on my machine:

suppressPackageStartupMessages(library(SingleR))

# Mocking up data with log-normalized expression values:
ref <- .mockRefData()
test <- .mockTestData(ref)

ref <- scuttle::logNormCounts(ref)
test <- scuttle::logNormCounts(test)

# Running the classification with different options:
SingleR(test, ref, labels=ref$label)
#> DataFrame with 100 rows and 4 columns
#>                                  scores      labels delta.next pruned.labels
#>                                <matrix> <character>  <numeric>   <character>
#> 1   -0.0147788:0.0264488:0.12898508:...           C  0.1025363             C
#> 2   -0.0104899:0.0331671:0.00738906:...           E  0.0910800             E
#> 3    0.0249717:0.0408587:0.00203195:...           D  0.0521095             D
#> 4    0.1014052:0.0373862:0.02674975:...           A  0.0640189             A
#> 5   -0.0240772:0.0175876:0.01874797:...           E  0.0719095             E
#> ...                                 ...         ...        ...           ...
#> 96  0.0499047: 0.02929928:0.0657537:...           D  0.0969816             D
#> 97  0.0202227: 0.00763344:0.0447376:...           D  0.1166725             D
#> 98  0.0642006: 0.01908204:0.0228159:...           A  0.0144964             A
#> 99  0.0251169: 0.03410851:0.1065300:...           C  0.0724215             C
#> 100 0.0325325:-0.01377622:0.0302404:...           D  0.0547933             D

Please also provide the output of BiocManager::valid() and sessionInfo(), e.g.,

BiocManager::valid()
#> 'getOption("repos")' replaces Bioconductor standard repositories, see
#> 'help("repositories", package = "BiocManager")' for details.
#> Replacement repositories:
#>     CRAN: https://cran.rstudio.com/
#> [1] TRUE
sessionInfo()
#> R Under development (unstable) (2023-10-28 r85429)
#> Platform: aarch64-apple-darwin20
#> Running under: macOS Ventura 13.6.1
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib 
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> time zone: Australia/Melbourne
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats4    stats     graphics  grDevices utils     datasets  methods  
#> [8] base     
#> 
#> other attached packages:
#>  [1] SingleR_2.5.0               SummarizedExperiment_1.33.1
#>  [3] Biobase_2.63.0              GenomicRanges_1.55.1       
#>  [5] GenomeInfoDb_1.39.1         IRanges_2.37.0             
#>  [7] S4Vectors_0.41.2            BiocGenerics_0.49.1        
#>  [9] MatrixGenerics_1.15.0       matrixStats_1.2.0          
#> 
#> loaded via a namespace (and not attached):
#>  [1] SparseArray_1.3.1           bitops_1.0-7               
#>  [3] scuttle_1.13.0              lattice_0.22-5             
#>  [5] digest_0.6.33               evaluate_0.23              
#>  [7] sparseMatrixStats_1.15.0    grid_4.4.0                 
#>  [9] fastmap_1.1.1               Matrix_1.6-4               
#> [11] BiocManager_1.30.22         SingleCellExperiment_1.25.0
#> [13] codetools_0.2-19            abind_1.4-5                
#> [15] cli_3.6.2                   rlang_1.1.2                
#> [17] crayon_1.5.2                XVector_0.43.0             
#> [19] reprex_2.0.2                withr_2.5.2                
#> [21] DelayedArray_0.29.0         yaml_2.3.8                 
#> [23] S4Arrays_1.3.1              tools_4.4.0                
#> [25] beachmat_2.19.0             parallel_4.4.0             
#> [27] BiocParallel_1.37.0         GenomeInfoDbData_1.2.11    
#> [29] rsvd_1.0.5                  lifecycle_1.0.4            
#> [31] zlibbioc_1.49.0             BiocSingular_1.19.0        
#> [33] fs_1.6.3                    irlba_2.3.5.1              
#> [35] ScaledMatrix_1.11.0         glue_1.6.2                 
#> [37] Rcpp_1.0.11                 xfun_0.41                  
#> [39] rstudioapi_0.15.0           knitr_1.45                 
#> [41] htmltools_0.5.7             rmarkdown_2.25             
#> [43] DelayedMatrixStats_1.25.1   compiler_4.4.0             
#> [45] RCurl_1.98-1.13

@LeaLe88
Copy link
Author

LeaLe88 commented Dec 13, 2023

Dear Pete,

Thank you very much for your reply.

Just using your code above I get the same error message:


# Mocking up data with log-normalized expression values:
ref <- .mockRefData()
test <- .mockTestData(ref)

ref <- scuttle::logNormCounts(ref)
test <- scuttle::logNormCounts(test)

# Running the classification with different options:
SingleR(test, ref, labels=ref$label)

Error:
Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.


> BiocManager::valid()
'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
    CRAN: https://cran.rstudio.com/

* sessionInfo()

R version 4.1.3 (2022-03-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.6 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

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    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] BiocManager_1.30.22         openxlsx_4.2.5.2            SingleCellExperiment_1.16.0 pheatmap_1.0.12             celldex_1.4.0              
 [6] SingleR_1.8.1               knitr_1.45                  reticulate_1.34.0           SeuratDisk_0.0.0.9021       Seurat_5.0.1               
[11] SeuratData_0.2.2.9001       SeuratObject_5.0.1          sp_2.1-2                    TCGAbiolinks_2.29.6         readxl_1.4.3               
[16] writexl_1.4.2               data.table_1.14.10          DESeq2_1.34.0               SummarizedExperiment_1.24.0 Biobase_2.54.0             
[21] MatrixGenerics_1.6.0        matrixStats_1.2.0           GenomicRanges_1.46.1        GenomeInfoDb_1.30.1         IRanges_2.28.0             
[26] S4Vectors_0.32.4            BiocGenerics_0.40.0         maftools_2.10.05            survminer_0.4.9             ggpubr_0.6.0               
[31] lubridate_1.9.3             forcats_1.0.0               stringr_1.5.1               dplyr_1.1.4                 purrr_1.0.2                
[36] readr_2.1.4                 tidyr_1.3.0                 tibble_3.2.1                ggplot2_3.4.4               tidyverse_2.0.0            
[41] rms_6.7-1                   Hmisc_5.1-1                 survcomp_1.44.1             prodlim_2023.08.28          survival_3.5-7             

loaded via a namespace (and not attached):
  [1] rsvd_1.0.5                    ica_1.0-3                     foreach_1.5.2                 lmtest_0.9-40                 crayon_1.5.2                 
  [6] MASS_7.3-60                   nlme_3.1-155                  backports_1.4.1               rlang_1.1.2                   XVector_0.34.0               
 [11] ROCR_1.0-11                   irlba_2.3.5.1                 SparseM_1.81                  limma_3.50.3                  filelock_1.0.3               
 [16] BiocParallel_1.28.3           bit64_4.0.5                   glue_1.6.2                    sctransform_0.4.1             parallel_4.1.3               
 [21] vipor_0.4.5                   spatstat.sparse_3.0-3         AnnotationDbi_1.56.2          dotCall64_1.1-1               spatstat.geom_3.2-7          
 [26] tidyselect_1.2.0              km.ci_0.5-6                   fitdistrplus_1.1-11           XML_3.99-0.16                 zoo_1.8-12                   
 [31] SuppDists_1.1-9.7             xtable_1.8-4                  RcppHNSW_0.5.0                MatrixModels_0.5-3            magrittr_2.0.3               
 [36] evaluate_0.23                 scuttle_1.4.0                 cli_3.6.2                     zlibbioc_1.40.0               rstudioapi_0.15.0            
 [41] miniUI_0.1.1.1                rpart_4.1.16                  fastDummies_1.7.3             shiny_1.8.0                   BiocSingular_1.10.0          
 [46] xfun_0.41                     cluster_2.1.2                 ggtext_0.1.2                  KEGGREST_1.34.0               interactiveDisplayBase_1.32.0
 [51] quantreg_5.97                 ggrepel_0.9.4                 listenv_0.9.0                 Biostrings_2.62.0             png_0.1-8                    
 [56] future_1.33.0                 withr_2.5.2                   bitops_1.0-7                  plyr_1.8.9                    cellranger_1.1.0             
 [61] GSEABase_1.56.0               pillar_1.9.0                  cachem_1.0.8                  multcomp_1.4-25               hdf5r_1.3.8                  
 [66] DelayedMatrixStats_1.16.0     vctrs_0.6.5                   ellipsis_0.3.2                generics_0.1.3                lava_1.7.3                   
 [71] tools_4.1.3                   foreign_0.8-82                beeswarm_0.4.0                munsell_0.5.0                 DelayedArray_0.20.0          
 [76] fastmap_1.1.1                 compiler_4.1.3                abind_1.4-5                   httpuv_1.6.13                 ExperimentHub_2.2.1          
 [81] plotly_4.10.3                 GenomeInfoDbData_1.2.7        gridExtra_2.3                 lattice_0.20-45               deldir_2.0-2                 
 [86] utf8_1.2.4                    later_1.3.2                   BiocFileCache_2.11.1          jsonlite_1.8.8                scales_1.3.0                 
 [91] graph_1.72.0                  ScaledMatrix_1.2.0            pbapply_1.7-2                 carData_3.0-5                 sparseMatrixStats_1.6.0      
 [96] genefilter_1.76.0             lazyeval_0.2.2                promises_1.2.1                car_3.1-2                     doParallel_1.0.17            
[101] goftest_1.2-3                 spatstat.utils_3.0-4          checkmate_2.3.1               rmarkdown_2.25                sandwich_3.1-0               
[106] cowplot_1.1.1                 Rtsne_0.17                    downloader_0.4                uwot_0.1.16                   igraph_1.6.0                 
[111] yaml_2.3.8                    survivalROC_1.0.3.1           htmltools_0.5.7               memoise_2.0.1                 locfit_1.5-9.8               
[116] viridisLite_0.4.2             digest_0.6.33                 mime_0.12                     rappdirs_0.3.3                KMsurv_0.1-5                 
[121] spam_2.10-0                   RSQLite_2.3.4                 future.apply_1.11.0           TCGAbiolinksGUI.data_1.15.1   blob_1.2.4                   
[126] survMisc_0.5.6                splines_4.1.3                 Formula_1.2-5                 labeling_0.4.3                AnnotationHub_3.2.2          
[131] gridtext_0.1.5                RCurl_1.98-1.13               broom_1.0.5                   hms_1.1.3                     colorspace_2.1-0             
[136] base64enc_0.1-3               ggbeeswarm_0.7.2              ggrastr_1.0.2                 nnet_7.3-17                   Rcpp_1.0.11                  
[141] RANN_2.6.1                    mvtnorm_1.2-4                 fansi_1.0.6                   tzdb_0.4.0                    parallelly_1.36.0            
[146] R6_2.5.1                      grid_4.1.3                    ggridges_0.5.4                lifecycle_1.0.4               polspline_1.1.24             
[151] zip_2.3.0                     curl_5.2.0                    ggsignif_0.6.4                leiden_0.4.3.1                Matrix_1.6-4                 
[156] RcppAnnoy_0.0.21              TH.data_1.1-2                 RColorBrewer_1.1-3            iterators_1.0.14              spatstat.explore_3.2-5       
[161] htmlwidgets_1.6.4             beachmat_2.10.0               polyclip_1.10-6               biomaRt_2.50.3                timechange_0.2.0             
[166] rvest_1.0.3                   globals_0.16.2                htmlTable_2.4.2               patchwork_1.1.3               spatstat.random_3.2-2        
[171] progressr_0.14.0              codetools_0.2-18              prettyunits_1.2.0             dbplyr_2.4.0                  RSpectra_0.16-1              
[176] gtable_0.3.4                  DBI_1.1.3                     tensor_1.5                    httr_1.4.7                    KernSmooth_2.23-20           
[181] stringi_1.8.3                 progress_1.2.3                reshape2_1.4.4                farver_2.1.1                  annotate_1.72.0              
[186] viridis_0.6.4                 DT_0.31                       xml2_1.3.6                    BiocNeighbors_1.12.0          rmeta_3.0                    
[191] geneplotter_1.72.0            scattermore_1.2               BiocVersion_3.14.0            bit_4.0.5                     spatstat.data_3.0-3          
[196] pkgconfig_2.0.3               rstatix_0.7.2                 bootstrap_2019.6             

Bioconductor version '3.14'

  * 0 packages out-of-date
  * 6 packages too new

create a valid installation with

  BiocManager::install(c(
    "BiocFileCache", "EnhancedVolcano", "ggtree", "TCGAbiolinks", "TCGAbiolinksGUI.data", "treeio"
  ), update = TRUE, ask = FALSE, force = TRUE)

more details: BiocManager::valid()$too_new, BiocManager::valid()$out_of_date

@dviraran
Copy link
Contributor

It seems that the new matrixStats is incompatible. Try:

remotes::install_version("matrixStats", version="1.1.0")

@PeteHaitch
Copy link
Contributor

There's also a few issues with your Bioconductor installation:

  • Firstly, you're using an older version of R and (mostly) software from Bioconductor v3.14. The current release version of Bioconductor is v3.18, which is compatible with R v4.3. Old versions of Bioconductor packages are frozen, meaning they can't be updated when incompatibilities with newer versions of dependencies (such as matrixStats) occur. The general advice is to use the current version of Bioconductor if you can, but otherwise @dviraran has provided a workaround.
    • Because of this, Bioconductor maintainers can generally only provide support for the current release version of a package.
  • Secondly, your Bioconductor installation has software from a mixture of releases. BiocManager::valid() warns you of this ("* 6 packages too new") and provides a remedy. For example, your BiocFileCache is v2.11.1, which is from Bioconducgtor v3.19 (the current development version of Bioconductor).
    • Unless you really know what you're doing, it's a bad idea to mix software from different versions of Bioconductor.
    • Fixing this won't fix the current issue, but you're likely to run into more issues down the line if you don't fix this.

@LeaLe88
Copy link
Author

LeaLe88 commented Dec 14, 2023

Hey both!

Thank you so much @dviraran it fixed the issue, what a relief!
And @PeteHaitch I totally agree with what you are saying. I need to check this. I guess it would be also good if we upgrade our RStudio, too!

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

4 participants